mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[mod] simplify code again
This commit is contained in:
parent
5194eb75c4
commit
8d94e1aa43
1 changed files with 4 additions and 9 deletions
|
@ -626,14 +626,6 @@ class ActionsMap(object):
|
||||||
arguments = action_options.pop('arguments', {})
|
arguments = action_options.pop('arguments', {})
|
||||||
tid = (namespace, category_name, action_name)
|
tid = (namespace, category_name, action_name)
|
||||||
|
|
||||||
if 'configuration' in action_options:
|
|
||||||
configuration = action_options.pop('configuration')
|
|
||||||
_set_conf = lambda p: p.set_conf(tid, configuration)
|
|
||||||
|
|
||||||
else:
|
|
||||||
# No action configuration
|
|
||||||
_set_conf = lambda p: False
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Get action parser
|
# Get action parser
|
||||||
action_parser = category_parser.add_action_parser(action_name, tid, **action_options)
|
action_parser = category_parser.add_action_parser(action_name, tid, **action_options)
|
||||||
|
@ -648,6 +640,9 @@ class ActionsMap(object):
|
||||||
# Store action identifier and add arguments
|
# Store action identifier and add arguments
|
||||||
action_parser.set_defaults(_tid=tid)
|
action_parser.set_defaults(_tid=tid)
|
||||||
_add_arguments(tid, action_parser, arguments)
|
_add_arguments(tid, action_parser, arguments)
|
||||||
_set_conf(category_parser)
|
|
||||||
|
if 'configuration' in action_options:
|
||||||
|
configuration = action_options.pop('configuration')
|
||||||
|
category_parser.set_conf(tid, configuration)
|
||||||
|
|
||||||
return top_parser
|
return top_parser
|
||||||
|
|
Loading…
Add table
Reference in a new issue