Skip to content

Commit

Permalink
bug 修复以及格式化
Browse files Browse the repository at this point in the history
time那里pythonista死活打不出来。。。规避掉了
  • Loading branch information
nico committed Mar 24, 2018
1 parent 3fa34a2 commit c5af9e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Silver.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def time_start(self):
temp = response.json()
# print (temp['code']) #宝箱领完返回的code为-10017
if temp['code'] == -10017:
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())), "今日宝箱领取完毕")
print("# 今日宝箱领取完毕")
else:
time_start = temp['data']['time_start']
return str(time_start)
Expand All @@ -56,7 +56,6 @@ def GetAward(self):
try:
time = self.CurrentTime()
timeend = self.time_end()
print("hello")
timestart = self.time_start()
temp_params = 'access_key=' + self.access_key + '&actionKey=' + self.actionKey + '&appkey=' + self.appkey + '&build=' + self.build + '&device=' + self.device + '&mobi_app=' + self.mobi_app + '&platform=' + self.platform + '&time_end=' + timeend + '&time_start=' + timestart + '&ts=' + time
params = temp_params + self.app_secret
Expand All @@ -72,13 +71,14 @@ def GetAward(self):

async def run(self):
while 1:
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())), "检查宝箱状态")
temp = self.GetAward()
if temp == None or temp == -10017:
print("# 半小时后检测是否第二天了")
await asyncio.sleep(1800)
elif temp == 0:
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())), "打开了宝箱")
print("# 打开了宝箱")
self.GetAward()
else:
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())), "继续等待宝箱冷却...")
print("# 继续等待宝箱冷却...")
await asyncio.sleep(181)

0 comments on commit c5af9e8

Please sign in to comment.