Exemplo n.º 1
0
def main():
    paras = lib.readParas()
    files = paras["files"].split("@@")
    paths = []
    for file in files:
        paths.append(file.split(";")[2])
    paras['paths'] = paths
    func = getattr(sys.modules[__name__], paras['op'])
    func(paras)
Exemplo n.º 2
0
def main():
    paras = lib.readParas()
    func = getattr(sys.modules[__name__], paras['op'])
    func(paras)
Exemplo n.º 3
0
Arquivo: mySql.py Projeto: gsrr/Python
        ret.append(copy.deepcopy(data))

    if paras.has_key("internal"):
        return ret
    else:
        print json.dumps(ret)


def insertElement(paras):
    cursor = paras["cursor"]
    sql = "INSERT INTO %s VALUES ('%s', '%s', '%s');" % (paras["table"], paras["id"], paras["label"], paras["path"])
    cursor.execute(sql)


def dropTable(paras):
    cursor = paras["cursor"]
    sql = "DROP TABLE %s" % (paras["table"])
    cursor.execute(sql)
    print "Delete Table Complete"


@connectDB
def main(paras):
    func = getattr(sys.modules[__name__], paras["op"])
    return func(paras)


if __name__ == "__main__":
    paras = lib.readParas()
    main(paras)
Exemplo n.º 4
0
def main():
    paras = lib.readParas()
    func = getattr(sys.modules[__name__], "kmdn_" + paras['name'].lower())
    path = "data/kmdn_" + paras['name'].lower() + ".result"
    return func(path)