Ejemplo n.º 1
0
def getFactoryPid_json():
    try:
        db = connectMySQL.connMySQL_mobileProduction()
    except MySQLdb.Error, e:
        print e
        resultStr = '{"status": "failed", "typeID": "factory", "code": "4001", "str": "connect database failed"}'
        return resultStr
Ejemplo n.º 2
0
def getFactoryPid_json():
    try:
        db=connectMySQL.connMySQL_mobileProduction()
    except MySQLdb.Error, e:
        print e
        resultStr='{"status": "failed", "typeID": "factory", "code": "4001", "str": "connect database failed"}'
        return resultStr
Ejemplo n.º 3
0
def getPid_json(typeID):
    isInDict = False
    for key in list:
        if 0 == cmp(key, typeID):
            isInDict = True
            break
    if isInDict == False:
        resultStr = '{"status": "failed", "typeID": "%s", "code": "4003", "str": "unknown typeID"}' % typeID
        return resultStr
    try:
        db = connectMySQL.connMySQL_mobileProduction()
    except MySQLdb.Error, e:
        print e
        resultStr = '{"status": "failed", "typeID": "%s", "code": "4001", "str": "connect database failed"}' % typeID
        return resultStr
Ejemplo n.º 4
0
def getPid_json(typeID):
    isInDict = False
    for key in list:
        if 0 == cmp(key, typeID):
            isInDict = True
            break
    if isInDict == False:
        resultStr='{"status": "failed", "typeID": "%s", "code": "4003", "str": "unknown typeID"}' % typeID
        return resultStr
    try:
        db=connectMySQL.connMySQL_mobileProduction()
    except MySQLdb.Error, e:
        print e
        resultStr='{"status": "failed", "typeID": "%s", "code": "4001", "str": "connect database failed"}' % typeID
        return resultStr