コード例 #1
0
ファイル: __init__.py プロジェクト: auduny/chains
def getCommandObject(section, command):
    cmds = commands.load(section, command)
    if not cmds:
        return
    if not cmds.has_key(section):
        raise InvalidParameterException("No such section: %s" % section)
    if not cmds[section].has_key(command):
        raise InvalidParameterException("No such command: %s in section: %s" % (command, section))
    obj = cmds[section][command]
    obj.init(amqp.Connection())
    return obj
コード例 #2
0
ファイル: __init__.py プロジェクト: olekenneth/chains
def getCommandObject(section, command):
    cmds = commands.load(section, command)
    if not cmds:
        return
    if not cmds.has_key(section):
        raise InvalidParameterException('No such section: %s' % section)
    if not cmds[section].has_key(command):
        raise InvalidParameterException('No such command: %s in section: %s' %
                                        (command, section))
    obj = cmds[section][command]
    obj.init(amqp.Connection())
    return obj
コード例 #3
0
ファイル: describe.py プロジェクト: auduny/chains
def getCommandHelp(section, command):
    dic = commands.load(section, command)
    obj = dic[section][command]
    fun = getattr(obj, "main")
    descr = introspect.describeMethod(fun)
    return descr
コード例 #4
0
def getCommandHelp(section, command):
    dic = commands.load(section, command)
    obj = dic[section][command]
    fun = getattr(obj, 'main')
    descr = introspect.describeMethod(fun)
    return descr