| | |
| | | #
|
| | | # è¯¦ç»æè¿°: 读åPY表
|
| | | #
|
| | | # @note: æ¬èæ¬ç± \PySysDB\çæIpyGameDataPY çæ
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2018-05-10 12:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
| | |
|
| | | def __LoadFileData(self, tableName, onlyCheck=False):
|
| | | # @param onlyCheck: æ¯å¦ä»
æ£æ¥æ ¼å¼ï¼ä¸è¬å¯å¨æ¶ç¨
|
| | | curPath = "<%LoadStructPath%>" + "\\PySysDB\\tag" + tableName + ".txt"
|
| | | curPath = "<%LoadStructPath%>" + "\\PySysDB\\" + tableName + ".txt"
|
| | | if not os.path.isfile(curPath):
|
| | | ErrLog("can not find file = %s,%s" % (tableName, curPath))
|
| | | raise Exception("can not find file = %s,%s" % (tableName, curPath))
|
| | | curPath = "<%LoadStructPath%>" + "\\PySysDB\\tag" + tableName + ".txt"
|
| | | if not os.path.isfile(curPath):
|
| | | ErrLog("can not find file = %s,%s" % (tableName, curPath))
|
| | | raise Exception("can not find file = %s,%s" % (tableName, curPath))
|
| | |
|
| | | if not onlyCheck:
|
| | | if not hasattr(self, "ipy%sLen" % tableName):
|
| | |
| | |
|
| | | def __StrToList(self, strValue):
|
| | | setList = []
|
| | | if ("[" in strValue and "]" in strValue) or ("(" in strValue and ")" in strValue):
|
| | | if (strValue.startswith("[") and strValue.endswith("]")) or (strValue.startswith("(") and strValue.endswith(")")):
|
| | | setList = eval(strValue)
|
| | | elif strValue in ["0", "-", ""]:
|
| | | pass
|
| | |
| | | for value in strValue.split(ChConfig.Def_Str_Montant):
|
| | | if value.isdigit():
|
| | | value = int(value)
|
| | | elif (value.startswith("[") and value.endswith("]")) or (value.startswith("(") and value.endswith(")")):
|
| | | value = eval(value)
|
| | | else:
|
| | | try:
|
| | | value = float(value)
|
| | | except:
|
| | | pass
|
| | | setList.append(value)
|
| | | if setList:
|
| | | setList = tuple(setList)
|