Add support for Star Wars characters - #2
Conversation
| args = parser.parse_args() | ||
|
|
||
| if not args.name_pack in NAME_PACKS: | ||
| print(f'Unknown name pack "{args.name_pack}", available packs: {", ".join(NAME_PACKS.keys())}') |
There was a problem hiding this comment.
Use .format notation to maintain Python 3.4+ support
| def main(): | ||
| parser = argparse.ArgumentParser(description='Generate the best sprint names.') | ||
| parser.add_argument('--name-pack', | ||
| action='store', |
There was a problem hiding this comment.
Store is the default so this argument can be left out
| parser = argparse.ArgumentParser(description='Generate the best sprint names.') | ||
| parser.add_argument('--name-pack', | ||
| action='store', | ||
| help='Name of the pack used for generating name.', |
There was a problem hiding this comment.
No period at end of argparse help messages
| 'Yoda', ] | ||
|
|
||
|
|
||
| NAME_PACKS = {'cyclists': CYCLISTS, 'starwars': STARWARS} |
There was a problem hiding this comment.
Instead of this dictionary, just capitalize the argparse argument given when pulling from the list.
| This project will generate the name of your team's next sprint by | ||
| combining a random adjective and a random name (chosen from a list of pro | ||
| cyclists). | ||
| combining a random adjective and a random name. There is a support |
There was a problem hiding this comment.
Remove "a" between "is" and "support"
|
|
||
| def main(): | ||
| parser = argparse.ArgumentParser(description='Generate the best sprint names.') | ||
| parser.add_argument('--name-pack', |
There was a problem hiding this comment.
Make this a choice argument so that namepack choices get displayed when help is invoked
| 'Schleck', 'Thomas', 'Ullrich', 'Uran', 'Valverde', 'VanGarderen', | ||
| 'Vaughters', 'Voigt', 'Vos', 'Wiggins', 'Zabel', 'Zabriskie'] | ||
|
|
||
| STARWARS = ['Ackbar', 'Amidala', 'Anakin', 'Andor', 'BB-8', 'Binks', 'C-3PO', |
There was a problem hiding this comment.
Please alphabetize so that future contributors can easily see if a name they may want is missing.
| combining a random adjective and a random name (chosen from a list of pro | ||
| cyclists). | ||
| combining a random adjective and a random name. There is a support | ||
| for several name packs - for example cyclists, star wars characters, ... |
There was a problem hiding this comment.
Make it say "There is currently support for several name packs (e.g. cyclists, Star Wars characters) and pull requests for new ones are encouraged."
No description provided.