添加daily report生成

This commit is contained in:
pengtao 2019-10-22 14:31:45 +08:00
parent 88586e63c7
commit 03ffb9443d

View File

@ -26,6 +26,8 @@ mail = Mail(app)
recipients = ["pengtao@kingsome.cn"]
FROMAPPID_CN = {"wxdb103a128e118619": "拯救熊猫泡泡", "wxc137c93eedeab6f2": "爆冰达人"}
def send_async_email(app, msg):
with app.app_context():
@ -229,7 +231,7 @@ class Report:
k = 0
else:
k = (100 * byshare / (activa - byshare))
return (fromappid, activa, new, share, k)
return (fromappid, FROMAPPID_CN.get(fromappid, None), activa, new, share, k)
except Exception:
log.error(f"collect input failed {self.gameid} {fromappid}", exc_info=True)
return None
@ -250,7 +252,7 @@ class Report:
try:
jump_num, jump_pre = self.tga.get_data(jump_sql)[0]
return (jump_num, jump_pre)
return (jump_appid, FROMAPPID_CN.get(jump_appid, None), jump_num, jump_pre)
except Exception:
log.error(f"get data from output by {self.gameid} {jump_appid} failed", exc_info=True)
return None
@ -265,7 +267,7 @@ class Report:
data['output'] = defaultdict(list)
data['input'] = []
data['output'] = []
fromappids = ['wxcff7381e631cf54e']
fromappids = FROMAPPID_CN.keys()
for fromappid in fromappids:
pdb.set_trace()
data['input'].append(self.get_input_fromappid(fromappid))