def command(*args, **kwargs):
def set_command(func):
if inspect.isfunction(func):
if not hasattr(func, '_command'):
func._command = []
for kw in kwargs:
setattr(func, '_' + kw, kwargs.get(kw, False))
for arg in args:
if arg not in func._command:
func._command.append(arg)
return func
return set_command
评论列表
文章目录