コード例 #1
0
    def caseCodeValue_get(self,word_all,causeValue,line):
        if causeValue == "UNDEF" or causeValue == "": return ""
        try:
            ret = int(causeValue)
        except:
            exCodeIndex = self.load_dict[self.getKeyStr(EXCEPTION_CODE)]
            exCodeList = []
#            exCodeList = [k for k,v in self.load_dict if v == exCodeIndex]
            for k in self.load_dict:
                if self.load_dict[k] == exCodeIndex:
                    exCodeList.append(k)
            exStr = ""
            for wd in word_all:
                if keyStrSplit in wd and filter(lambda ex:re.search(ex.lower(),wd.lower()),exCodeList):
                    exStr = wd
                    break
            if not exStr:
                raise Exception("CaseCode get Error:Cannot find key ExceptionCode when causevalue is not int:%s"%line)
            try:
                tmp = exStr.split(keyStrSplit)
                exValue = int(tmp[1].strip(" ").strip("\n").rstrip('"'))
            except:
#                raise Exception("CaseCode get Error, line:%s" % word_all)
                exValue = -1
            ret = DBInfo.get_causecode_value(causeValue,exValue)
        return str(ret)
コード例 #2
0
'''
Created on 2012-8-1

@author: liaopengyu
'''
from util.loadInfo import DBInfo
print 'exec MatchException @ExceptionCode=%d, @CauseCodeString=%s'%(310,'dl_radio_resources_not_available')
ret = DBInfo.get_causecode_value('dl_radio_resources_not_available', 310)
print ret
ret = DBInfo.get_causecode_value('dl_radio_resources_not_available', 310)
print ret
#DBInfo.current.execute('exec MatchException @ExceptionCode=%d, @CauseCodeString=%s',(310,'dl_radio_resources_not_available'))
#print DBInfo.current.fetchall()[0][0]     
#