This commit is contained in:
Florian Bruhin 2014-05-12 11:22:17 +02:00
parent 366af0dd4c
commit df3528e454

View File

@ -30,7 +30,6 @@ cmd_dict = {}
def arg_or_count(arg, count, default=None, countzero=None): def arg_or_count(arg, count, default=None, countzero=None):
"""Get a value based on an argument and count given to a command. """Get a value based on an argument and count given to a command.
If both arg and count are set, ValueError is raised. If both arg and count are set, ValueError is raised.
@ -122,6 +121,7 @@ class register: # pylint: disable=invalid-name
Return: Return:
The original function (unmodified). The original function (unmodified).
""" """
# pylint: disable=no-member
names = [] names = []
name = func.__name__.lower() if self.name is None else self.name name = func.__name__.lower() if self.name is None else self.name
if isinstance(name, str): if isinstance(name, str):
@ -131,7 +131,6 @@ class register: # pylint: disable=invalid-name
mainname = name[0] mainname = name[0]
names += name names += name
argspec = inspect.getfullargspec(func) argspec = inspect.getfullargspec(func)
# pylint: disable=no-member
if 'self' in argspec.args and self.instance is None: if 'self' in argspec.args and self.instance is None:
raise ValueError("{} is a class method, but instance was not " raise ValueError("{} is a class method, but instance was not "
"given!".format(mainname)) "given!".format(mainname))