[BD-18] Optimize paver settings call
This commit is contained in:
@@ -22,14 +22,15 @@ class Command(BaseCommand):
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
'setting',
|
||||
help='Specifies the setting to be printed.'
|
||||
'settings_to_print',
|
||||
nargs='+',
|
||||
help='Specifies the list of settings to be printed.'
|
||||
)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
setting = options.get('setting')
|
||||
settings_to_print = options.get('settings_to_print')
|
||||
|
||||
if not hasattr(settings, setting):
|
||||
raise CommandError(u'%s not found in settings.' % setting)
|
||||
|
||||
print(getattr(settings, setting))
|
||||
for setting in settings_to_print:
|
||||
if not hasattr(settings, setting):
|
||||
raise CommandError('%s not found in settings.' % setting)
|
||||
print(getattr(settings, setting))
|
||||
|
||||
Reference in New Issue
Block a user