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.
|
# Each parser classes must implement these methods.
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def format_arg_names(self, name, full):
|
def format_arg_names(name, full):
|
||||||
"""Format argument name
|
"""Format argument name
|
||||||
|
|
||||||
Format agument name depending on its 'full' parameter and return
|
Format agument name depending on its 'full' parameter and return
|
||||||
|
@ -70,9 +70,7 @@ class BaseActionsMapParser(object):
|
||||||
A list of option strings
|
A list of option strings
|
||||||
|
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError(
|
raise NotImplementedError("derived class must override this method")
|
||||||
"derived class '%s' must override this method" % self.__class__.__name__
|
|
||||||
)
|
|
||||||
|
|
||||||
def has_global_parser(self):
|
def has_global_parser(self):
|
||||||
return False
|
return False
|
||||||
|
@ -156,7 +154,8 @@ class BaseActionsMapParser(object):
|
||||||
|
|
||||||
# Arguments helpers
|
# 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"""
|
"""Prepare the namespace for a given action"""
|
||||||
# Validate tid and namespace
|
# Validate tid and namespace
|
||||||
if not isinstance(tid, tuple) and (
|
if not isinstance(tid, tuple) and (
|
||||||
|
|
|
@ -287,7 +287,7 @@ class ActionsMapParser(BaseActionsMapParser):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def format_arg_names(name, full):
|
def format_arg_names(name, full):
|
||||||
if name[0] == "-" and full:
|
if name.startswith("-") and full:
|
||||||
return [name, full]
|
return [name, full]
|
||||||
return [name]
|
return [name]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue