| | |
| | | ClassFuncTemp = " def Get%s(self): return self.%s%s%s"
|
| | |
|
| | | # 管çå¨åå§åè¡¨æ°æ®ç¼åå表对象模æ¿
|
| | | MgrTableCacheInit = " self.ipy%sCache = self.__LoadFileData(\"%s\", IPY_%s)%s"
|
| | | MgrTableLenInit = " self.ipy%sLen = len(self.ipy%sCache)%s"
|
| | | # 管çå¨è·åè¡¨æ°æ®æ¡æ°å½æ°æ¨¡æ¿
|
| | | MgrGetCountFunc = " def Get%sCount(self): return self.ipy%sLen%s"
|
| | | # 管ç卿 ¹æ®ç´¢å¼è·åè¡¨æ°æ®å½æ°æ¨¡æ¿
|
| | | MgrGetByIndexFunc = " def Get%sByIndex(self, index): return self.ipy%sCache[index]%s"
|
| | | MgrTableCacheInit = " self.__LoadFileData(\"%s\", onlyCheck)%s"
|
| | | # 管çå¨è·åè¡¨æ°æ®æ¡æ°ãæ°æ®å½æ°æ¨¡æ¿
|
| | | MgrGetCountFunc = '''
|
| | | def Get%sCount(self):
|
| | | self.CheckLoadData("%s")
|
| | | return self.ipy%sLen\r
|
| | | def Get%sByIndex(self, index):
|
| | | self.CheckLoadData("%s")
|
| | | return self.ipy%sCache[index]\r
|
| | | '''
|
| | |
|
| | | Def_RN = "\r\n"
|
| | |
|
| | |
| | | classInitInfo += ClassInitTemp % (fieldName, "0.0", lineEnd)
|
| | | else:
|
| | | classInitInfo += ClassInitTemp % (fieldName, "0", lineEnd)
|
| | | classFuncInfo += ClassFuncTemp % (fieldName, fieldName, noteInfo, lineEnd)
|
| | | callAttrValue = "attrTuple[%s]" % j # fieldName
|
| | | classFuncInfo += ClassFuncTemp % (fieldName, callAttrValue, noteInfo, lineEnd)
|
| | |
|
| | | ipyTableDef += TableDefEnd % (Def_RN if i == len(Def_IpyTable) - 1 else (Def_RN * 2))
|
| | | classInitInfo = ClassInitTemp % ("attrTuple", "None", "") # ä¼åå
åï¼ä¸ä½¿ç¨å
ç½® __dict__ 访é®å±æ§ï¼æ¹ä¸ºä½¿ç¨tupleåvalue
|
| | | classContent += ClassTemp % (tableNameCh, tableName, classInitInfo, classFuncInfo)
|
| | |
|
| | | # 表å表ãé¿åº¦å¯¹è±¡ç¼å
|
| | | mgrTableCacheObjInit += MgrTableCacheInit % (tableName, tableName, tableName, Def_RN)
|
| | | mgrTableCacheObjInit += MgrTableLenInit % (tableName, tableName, Def_RN)
|
| | | mgrTableCacheObjInit += MgrTableCacheInit % (tableName, Def_RN)
|
| | |
|
| | | # 表å表ãé¿åº¦è·å彿°
|
| | | mgrTableFunc += MgrGetCountFunc % (tableName, tableName, Def_RN)
|
| | | mgrTableFunc += MgrGetByIndexFunc % (tableName, tableName, Def_RN)
|
| | | |
| | | mgrTableFunc += MgrGetCountFunc % (tableName, tableName, tableName, tableName, tableName, tableName)
|
| | |
|
| | | # è¯»åæ¨¡æ¿çæpy代ç
|
| | | createPYContent = ""
|