Esempio n. 1
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
Esempio n. 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
Esempio n. 3
0
def getCommandHelp(section, command):
    dic = commands.load(section, command)
    obj = dic[section][command]
    fun = getattr(obj, "main")
    descr = introspect.describeMethod(fun)
    return descr
Esempio n. 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