# HG changeset patch # User Teemu Piippo # Date 1439032650 -10800 # Node ID 1759c15cd0cacc31157c43e7f5bb2b34caa3f029 # Parent 7e225c2659b8e548fb429c0aef6c44f8e44d3439 Added ability to define commands into the manifest diff -r 7e225c2659b8 -r 1759c15cd0ca modulecore.py --- a/modulecore.py Sat Aug 08 14:17:06 2015 +0300 +++ b/modulecore.py Sat Aug 08 14:17:30 2015 +0300 @@ -180,12 +180,16 @@ def exec_command (commandObject): global g_lastConfirm global g_confirmCommand - cmdname = commandObject['cmdname'] - try: - func = getattr (commandObject['module'], 'cmd_' + cmdname) - except AttributeError: - command_error ('''command '%s' does not have a definition''' % cmdname) + if 'function' in commandObject: + func = commandObject['function'] + else: + cmdname = commandObject['cmdname'] + + try: + func = getattr (commandObject['module'], 'cmd_' + cmdname) + except AttributeError: + command_error ('''command '%s' does not have a definition''' % cmdname) try: func (**commandObject)