Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
fix some bug and add contact us
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu committed Mar 17, 2019
1 parent 3c277a7 commit 0ae8ab6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 9 deletions.
16 changes: 8 additions & 8 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

__author__ = "yanyongyu"
__all__ = ["cxmooc_tool", "poxiaobbs", "forestpolice", "bankroft",
"jiuaidaikan"]
"jiuaidaikan", "wangke120"]

import sys
import json
Expand Down Expand Up @@ -49,7 +49,7 @@ async def cxmooc_tool(sess: requests.Session,
logging.info("Request Exception appeared: %s" % e)
for each in args:
answer = []
answer.append({'topic': utils.decode_uri_component(e),
answer.append({'topic': utils.decode_uri_component(str(e)),
'correct': ''})
yield answer
raise StopIteration
Expand Down Expand Up @@ -102,7 +102,7 @@ async def poxiaobbs(sess: requests.Session,
except requests.exceptions.RequestException as e:
logging.info("Request Exception appeared: %s" % e)
answer = []
answer.append({'topic': utils.decode_uri_component(e),
answer.append({'topic': utils.decode_uri_component(str(e)),
'correct': ''})
index = yield answer
continue
Expand Down Expand Up @@ -159,7 +159,7 @@ async def forestpolice(sess: requests.Session,
except requests.exceptions.RequestException as e:
logging.info("Request Exception appeared: %s" % e)
answer = []
answer.append({'topic': utils.decode_uri_component(e),
answer.append({'topic': utils.decode_uri_component(str(e)),
'correct': ''})
index = yield answer
continue
Expand Down Expand Up @@ -218,7 +218,7 @@ async def bankroft(sess: requests.Session,
except requests.exceptions.RequestException as e:
logging.info("Request Exception appeared: %s" % e)
answer = []
answer.append({'topic': utils.decode_uri_component(e),
answer.append({'topic': utils.decode_uri_component(str(e)),
'correct': ''})
index = yield answer
continue
Expand Down Expand Up @@ -283,7 +283,7 @@ async def jiuaidaikan(sess: requests.Session,
if index and i < index:
continue
answer = []
answer.append({'topic': utils.decode_uri_component(e),
answer.append({'topic': utils.decode_uri_component(str(e)),
'correct': ''})
yield answer
raise StopIteration
Expand All @@ -308,7 +308,7 @@ async def jiuaidaikan(sess: requests.Session,
except requests.exceptions.RequestException as e:
logging.info("Request Exception appeared: %s" % e)
answer = []
answer.append({'topic': utils.decode_uri_component(e),
answer.append({'topic': utils.decode_uri_component(str(e)),
'correct': ''})
index = yield answer
continue
Expand Down Expand Up @@ -359,7 +359,7 @@ async def wangke120(sess: requests.Session,
except requests.exceptions.RequestException as e:
logging.info("Request Exception appeared: %s" % e)
answer = []
answer.append({'topic': utils.decode_uri_component(e),
answer.append({'topic': utils.decode_uri_component(str(e)),
'correct': ''})
index = yield answer
continue
Expand Down
34 changes: 33 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,43 @@ def _unscroll_text(event):
frame3 = Frame(self.root, style='White.TFrame')
frame3.pack(side=BOTTOM, fill=X)
button1 = Button(frame3, text="查询", command=self.start_search, style='TButton')
button1.pack(side=TOP)
button1.pack(side=LEFT, expand=True)

button2 = Button(frame3, text="加入我们", command=self.contact_us, style='TButton')
button2.pack(side=RIGHT)

self.root.update()
self.root.mainloop()

def contact_us(self):
top = Toplevel(self.root)
top.geometry('350x150')
top.resizable(False, False)
frame = Frame(top)
frame.pack(fill=BOTH)

Label(frame, text="全自动插件下载/作者:CodFrm").pack()
self.plugin = StringVar()
self.plugin.set("https://github.com/CodFrm/cxmooc-tools/releases")
entry1 = Entry(frame, width=50, textvariable=self.plugin)
entry1.pack()
entry1['state'] = "readonly"

Label(frame, text="本软件更新下载地址/作者:Joker").pack()
self.download = StringVar()
self.download.set("https://github.com/yanyongyu/CXmoocSearchTool/releases")
entry2 = Entry(frame, width=50, textvariable=self.download)
entry2.pack()
entry2['state'] = "readonly"

Label(frame, text="QQ群号:").pack(side=LEFT)
self.qq = StringVar()
self.qq.set("614202391")
entry3 = Entry(frame, textvariable=self.qq)
entry3.pack(side=LEFT)
entry3['state'] = "readonly"


def start_search(self):
text = self.text1.get(1.0, END).strip(' \n\r').split('\n')
logging.info("Text get: %s" % text)
Expand Down

0 comments on commit 0ae8ab6

Please sign in to comment.