create decorator for plugin creation (thanks @datagrok)

pull/1/head
Mallory Hancock 2017-09-27 16:54:08 -07:00
parent eea3302542
commit 87332c1ac4
1 changed files with 7 additions and 0 deletions

View File

@ -17,3 +17,10 @@ def message(msg):
def add_plugin(command, func):
cmds.append({'cmd': command, 'func': func})
def register(command):
def register_for_command(func):
add_plugin(command, func)
return func
return register_for_command