Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit 51db2a9

Browse files
author
Matthias Koeppe
committed
sage_bootstrap: Eliminate terminology 'package class' in help and error messages
1 parent b762c3d commit 51db2a9

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

build/sage_bootstrap/cmdline.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
epilog_list = \
6060
"""
61-
Print a list of all available packages
61+
Print a list of packages known to Sage
6262
6363
EXAMPLE:
6464
@@ -197,15 +197,17 @@ def make_parser():
197197
parser_list = subparsers.add_parser(
198198
'list', epilog=epilog_list,
199199
formatter_class=argparse.RawDescriptionHelpFormatter,
200-
help='Print a list of all available packages')
200+
help='Print a list of packages known to Sage')
201201
parser_list.add_argument(
202-
'package_class',
202+
'package_class', metavar='[package_name|:package_type:]',
203203
type=str, default=[':all:'], nargs='*',
204-
help='Package class like :all: (default) or :standard:')
204+
help=('package name or designator for all packages of a given type '
205+
'(one of :all:, :standard:, :optional:, :experimental:, and :huge:); '
206+
'default: :all:'))
205207
parser_list.add_argument(
206208
'--has-file', action='append', default=[], metavar='FILENAME', dest='has_files',
207-
help='Only include packages that have this file')
208-
209+
help=('only include packages that have this file in their metadata directory'
210+
'(examples: SPKG.rst, spkg-configure.m4, distros/debian.txt)'))
209211
parser_name = subparsers.add_parser(
210212
'name', epilog=epilog_name,
211213
formatter_class=argparse.RawDescriptionHelpFormatter,

build/sage_bootstrap/expand_class.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
Utility to specify classes of packages like `:all:`
3+
Utility to manage lists of packages
44
"""
55

66

@@ -44,10 +44,11 @@ def included_in_filter(pkg):
4444
elif package_name_or_class == ':huge:':
4545
self._init_huge(predicate=included_in_filter)
4646
else:
47-
if package_name_or_class.startswith(':'):
48-
raise ValueError('Package name cannot start with ":", got %s', package_name_or_class)
49-
if package_name_or_class.endswith(':'):
50-
raise ValueError('Package name cannot end with ":", got %s', package_name_or_class)
47+
if ':' in package_name_or_class:
48+
raise ValueError('a colon may only appear in designators of package types, '
49+
'which must be one of '
50+
':all:, :standard:, :optional:, :experimental:, or :huge:, '
51+
'got {}'.format(package_name_or_class))
5152
self.names.append(package_name_or_class)
5253

5354
def _init_all(self, predicate):

0 commit comments

Comments
 (0)