개정판 9f428148
issue #1172: 데이터 이관 - SQLite에 있는 데이타를 MSSQL로 이관한다
Change-Id: I11bba04b97b5cdd8462e1d24f909d76dcf43cd95
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
111 | 111 |
self._titleBlockProperties = None |
112 | 112 |
self.needReOpening = None |
113 | 113 |
|
114 |
self.configTable = None
|
|
114 |
self._configs = None
|
|
115 | 115 |
|
116 | 116 |
def clearItemList(self, trim): |
117 | 117 |
''' |
... | ... | |
1170 | 1170 |
""" get configurations from database """ |
1171 | 1171 |
res = [] |
1172 | 1172 |
|
1173 |
if self.configTable is None:
|
|
1174 |
self.configTable = []
|
|
1173 |
if self._configs is None:
|
|
1174 |
self._configs = []
|
|
1175 | 1175 |
conn = self.project.database.connect() |
1176 | 1176 |
with conn: |
1177 | 1177 |
try: |
... | ... | |
1183 | 1183 |
cursor.execute(sql) |
1184 | 1184 |
rows = cursor.fetchall() |
1185 | 1185 |
for row in rows: |
1186 |
self.configTable.append(Config(row[0], row[1], row[2]))
|
|
1186 |
self._configs.append(Config(row[0], row[1], row[2]))
|
|
1187 | 1187 |
# Catch the exception |
1188 | 1188 |
except Exception as ex: |
1189 | 1189 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
1190 | 1190 |
|
1191 | 1191 |
if key is not None: |
1192 |
for con in self.configTable: |
|
1193 |
if con.section == section and con.key == key: |
|
1194 |
res.append(con) |
|
1192 |
return [con for con in self._configs if con.section == section and con.key == key] |
|
1195 | 1193 |
else: |
1196 |
for con in self.configTable: |
|
1197 |
if con.section == section: |
|
1198 |
res.append(con) |
|
1194 |
return [con for con in self._configs if con.section == section] |
|
1199 | 1195 |
|
1200 | 1196 |
return res |
1201 | 1197 |
|
... | ... | |
1268 | 1264 |
else: |
1269 | 1265 |
if sql is not None and 2 == len(sql): |
1270 | 1266 |
cursor.execute(self.project.database.to_sql(sql[0]), sql[1]) |
1267 |
self.configTable = None # reset config table |
|
1271 | 1268 |
conn.commit() |
1272 | 1269 |
# Catch the exception |
1273 | 1270 |
except Exception as ex: |
... | ... | |
3110 | 3107 |
@property |
3111 | 3108 |
def OCRData(self): |
3112 | 3109 |
if self._OCRData is None: |
3113 |
configs = self.getConfigs('Text Recognition', 'OCR Data')
|
|
3110 |
configs = self.etConfigs('Text Recognition', 'OCR Data') |
|
3114 | 3111 |
self._OCRData = configs[0].value if 1 == len(configs) else 'eng' |
3115 | 3112 |
|
3116 | 3113 |
return self._OCRData |
내보내기 Unified diff