mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-27 10:03:59 +00:00
Add helper _get_option_name() which finds name of the option for current Command
Command class has a get_command_name() but it returns the class's name, not the name of the option as declared in setup cmdclass dict.
This commit is contained in:
committed by
Wieland Hoffmann
parent
2e247a708d
commit
f5197652d2
8
setup.py
8
setup.py
@@ -366,6 +366,14 @@ except ImportError:
|
||||
_exit("Babel is required to use this command (see po/README.md)")
|
||||
|
||||
|
||||
def _get_option_name(obj):
|
||||
"""Returns the name of the option for specified Command object"""
|
||||
for name, klass in obj.distribution.cmdclass.iteritems():
|
||||
if obj.__class__ == klass:
|
||||
return name
|
||||
raise Exception("No such command class")
|
||||
|
||||
|
||||
class picard_update_countries(Command):
|
||||
description = "Regenerate countries.py"
|
||||
user_options = [
|
||||
|
||||
Reference in New Issue
Block a user