mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
staticmethod and format_arg_names fix
This commit is contained in:
parent
3730c418ad
commit
a47a230611
2 changed files with 5 additions and 6 deletions
|
@ -55,7 +55,7 @@ class BaseActionsMapParser(object):
|
|||
# Each parser classes must implement these methods.
|
||||
|
||||
@staticmethod
|
||||
def format_arg_names(self, name, full):
|
||||
def format_arg_names(name, full):
|
||||
"""Format argument name
|
||||
|
||||
Format agument name depending on its 'full' parameter and return
|
||||
|
@ -70,9 +70,7 @@ class BaseActionsMapParser(object):
|
|||
A list of option strings
|
||||
|
||||
"""
|
||||
raise NotImplementedError(
|
||||
"derived class '%s' must override this method" % self.__class__.__name__
|
||||
)
|
||||
raise NotImplementedError("derived class must override this method")
|
||||
|
||||
def has_global_parser(self):
|
||||
return False
|
||||
|
@ -156,7 +154,8 @@ class BaseActionsMapParser(object):
|
|||
|
||||
# Arguments helpers
|
||||
|
||||
def prepare_action_namespace(self, tid, namespace=None):
|
||||
@staticmethod
|
||||
def prepare_action_namespace(tid, namespace=None):
|
||||
"""Prepare the namespace for a given action"""
|
||||
# Validate tid and namespace
|
||||
if not isinstance(tid, tuple) and (
|
||||
|
|
|
@ -287,7 +287,7 @@ class ActionsMapParser(BaseActionsMapParser):
|
|||
|
||||
@staticmethod
|
||||
def format_arg_names(name, full):
|
||||
if name[0] == "-" and full:
|
||||
if name.startswith("-") and full:
|
||||
return [name, full]
|
||||
return [name]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue