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])
|
subcategories_subparser = copy.copy(action_group._group_actions[0])
|
||||||
|
|
||||||
# Filter "action"-type and "subcategory"-type commands
|
# 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"])
|
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"])
|
subcategories_subparser.choices = OrderedDict([(k, v) for k, v in subcategories_subparser.choices.items() if v.type == "subcategory"])
|
||||||
|
|
||||||
actions_choices = actions_subparser.choices.keys()
|
actions_choices = actions_subparser.choices.keys()
|
||||||
subcategories_choices = subcategories_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 ]
|
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 ]
|
subcategories_subparser._choices_actions = [c for c in choice_actions if c.dest in subcategories_choices]
|
||||||
|
|
||||||
# Display each section (actions and subcategories)
|
# Display each section (actions and subcategories)
|
||||||
if actions_choices != []:
|
if actions_choices != []:
|
||||||
|
|
|
@ -411,9 +411,9 @@ class _ActionsMapPlugin(object):
|
||||||
raise e
|
raise e
|
||||||
import traceback
|
import traceback
|
||||||
tb = traceback.format_exc()
|
tb = traceback.format_exc()
|
||||||
logs = { "route": _route,
|
logs = {"route": _route,
|
||||||
"arguments": arguments,
|
"arguments": arguments,
|
||||||
"traceback": tb }
|
"traceback": tb}
|
||||||
return HTTPErrorResponse(json_encode(logs))
|
return HTTPErrorResponse(json_encode(logs))
|
||||||
else:
|
else:
|
||||||
return format_for_response(ret)
|
return format_for_response(ret)
|
||||||
|
|
|
@ -317,7 +317,6 @@ class ActionsMapParser(BaseActionsMapParser):
|
||||||
|
|
||||||
self.global_parser.add_argument(*names, **argument_options)
|
self.global_parser.add_argument(*names, **argument_options)
|
||||||
|
|
||||||
|
|
||||||
def parse_args(self, args, **kwargs):
|
def parse_args(self, args, **kwargs):
|
||||||
try:
|
try:
|
||||||
ret = self._parser.parse_args(args)
|
ret = self._parser.parse_args(args)
|
||||||
|
|
Loading…
Add table
Reference in a new issue