mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[mod] pep8
This commit is contained in:
parent
5bf2f46f47
commit
09f49e4a8a
4 changed files with 92 additions and 93 deletions
|
@ -604,14 +604,14 @@ class ExtendedArgumentParser(argparse.ArgumentParser):
|
|||
subcategories_subparser = copy.copy(action_group._group_actions[0])
|
||||
|
||||
# Filter "action"-type and "subcategory"-type commands
|
||||
actions_subparser.choices = OrderedDict([(k,v) for k,v in actions_subparser.choices.items() if v.type == "action"])
|
||||
subcategories_subparser.choices = OrderedDict([(k,v) for k,v in subcategories_subparser.choices.items() if v.type == "subcategory"])
|
||||
actions_subparser.choices = OrderedDict([(k, v) for k, v in actions_subparser.choices.items() if v.type == "action"])
|
||||
subcategories_subparser.choices = OrderedDict([(k, v) for k, v in subcategories_subparser.choices.items() if v.type == "subcategory"])
|
||||
|
||||
actions_choices = actions_subparser.choices.keys()
|
||||
subcategories_choices = subcategories_subparser.choices.keys()
|
||||
|
||||
actions_subparser._choices_actions = [ c for c in choice_actions if c.dest in actions_choices ]
|
||||
subcategories_subparser._choices_actions = [ c for c in choice_actions if c.dest in subcategories_choices ]
|
||||
actions_subparser._choices_actions = [c for c in choice_actions if c.dest in actions_choices]
|
||||
subcategories_subparser._choices_actions = [c for c in choice_actions if c.dest in subcategories_choices]
|
||||
|
||||
# Display each section (actions and subcategories)
|
||||
if actions_choices != []:
|
||||
|
|
|
@ -411,9 +411,9 @@ class _ActionsMapPlugin(object):
|
|||
raise e
|
||||
import traceback
|
||||
tb = traceback.format_exc()
|
||||
logs = { "route": _route,
|
||||
logs = {"route": _route,
|
||||
"arguments": arguments,
|
||||
"traceback": tb }
|
||||
"traceback": tb}
|
||||
return HTTPErrorResponse(json_encode(logs))
|
||||
else:
|
||||
return format_for_response(ret)
|
||||
|
|
|
@ -317,7 +317,6 @@ class ActionsMapParser(BaseActionsMapParser):
|
|||
|
||||
self.global_parser.add_argument(*names, **argument_options)
|
||||
|
||||
|
||||
def parse_args(self, args, **kwargs):
|
||||
try:
|
||||
ret = self._parser.parse_args(args)
|
||||
|
|
Loading…
Add table
Reference in a new issue