修复空文件生成的BUG

This commit is contained in:
pengtao 2019-08-13 14:54:43 +08:00
parent 2d37c4a477
commit f946d10a27

View File

@ -31,15 +31,16 @@ class TGA_event(GetFromTga):
cast(json_extract(button_param,'$.id') as int)"""
out = self.tga.get_data(sql)
for line in out:
if line:
temp = {}
try:
temp['id'], temp['num'] = line
except Exception:
log.error(f"write {line} 2 tga failed!", exc_info=True)
if temp:
self.write_tga_files(temp)
if out:
for line in out:
if line:
temp = {}
try:
temp['id'], temp['num'] = line
except Exception:
log.error(f"write {line} 2 tga failed!", exc_info=True)
if temp:
self.write_tga_files(temp)
def event_shop_new(self):
sql = f"""select
@ -60,15 +61,16 @@ class TGA_event(GetFromTga):
out = self.tga.get_data(sql)
for line in out:
if line:
temp = {}
try:
temp['id'], temp['num'] = line
if temp:
self.write_tga_files(temp)
except Exception:
log.error(f"write {line} 2 tga failed!", exc_info=True)
if out:
for line in out:
if line:
temp = {}
try:
temp['id'], temp['num'] = line
if temp:
self.write_tga_files(temp)
except Exception:
log.error(f"write {line} 2 tga failed!", exc_info=True)
def event_tap(self):
for item in tap_items: