예제 #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
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