staticmethod and format_arg_names fix

This commit is contained in:
Kay0u 2020-01-14 22:45:19 +07:00
parent 3730c418ad
commit a47a230611
No known key found for this signature in database
GPG key ID: 7FF262C033518333
2 changed files with 5 additions and 6 deletions

View file

@ -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 (

View file

@ -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]