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

Commit 0ae8ab6

Browse files
committed
fix some bug and add contact us
1 parent 3c277a7 commit 0ae8ab6

File tree

2 files changed

+41
-9
lines changed

2 files changed

+41
-9
lines changed

api.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
__author__ = "yanyongyu"
88
__all__ = ["cxmooc_tool", "poxiaobbs", "forestpolice", "bankroft",
9-
"jiuaidaikan"]
9+
"jiuaidaikan", "wangke120"]
1010

1111
import sys
1212
import json
@@ -49,7 +49,7 @@ async def cxmooc_tool(sess: requests.Session,
4949
logging.info("Request Exception appeared: %s" % e)
5050
for each in args:
5151
answer = []
52-
answer.append({'topic': utils.decode_uri_component(e),
52+
answer.append({'topic': utils.decode_uri_component(str(e)),
5353
'correct': ''})
5454
yield answer
5555
raise StopIteration
@@ -102,7 +102,7 @@ async def poxiaobbs(sess: requests.Session,
102102
except requests.exceptions.RequestException as e:
103103
logging.info("Request Exception appeared: %s" % e)
104104
answer = []
105-
answer.append({'topic': utils.decode_uri_component(e),
105+
answer.append({'topic': utils.decode_uri_component(str(e)),
106106
'correct': ''})
107107
index = yield answer
108108
continue
@@ -159,7 +159,7 @@ async def forestpolice(sess: requests.Session,
159159
except requests.exceptions.RequestException as e:
160160
logging.info("Request Exception appeared: %s" % e)
161161
answer = []
162-
answer.append({'topic': utils.decode_uri_component(e),
162+
answer.append({'topic': utils.decode_uri_component(str(e)),
163163
'correct': ''})
164164
index = yield answer
165165
continue
@@ -218,7 +218,7 @@ async def bankroft(sess: requests.Session,
218218
except requests.exceptions.RequestException as e:
219219
logging.info("Request Exception appeared: %s" % e)
220220
answer = []
221-
answer.append({'topic': utils.decode_uri_component(e),
221+
answer.append({'topic': utils.decode_uri_component(str(e)),
222222
'correct': ''})
223223
index = yield answer
224224
continue
@@ -283,7 +283,7 @@ async def jiuaidaikan(sess: requests.Session,
283283
if index and i < index:
284284
continue
285285
answer = []
286-
answer.append({'topic': utils.decode_uri_component(e),
286+
answer.append({'topic': utils.decode_uri_component(str(e)),
287287
'correct': ''})
288288
yield answer
289289
raise StopIteration
@@ -308,7 +308,7 @@ async def jiuaidaikan(sess: requests.Session,
308308
except requests.exceptions.RequestException as e:
309309
logging.info("Request Exception appeared: %s" % e)
310310
answer = []
311-
answer.append({'topic': utils.decode_uri_component(e),
311+
answer.append({'topic': utils.decode_uri_component(str(e)),
312312
'correct': ''})
313313
index = yield answer
314314
continue
@@ -359,7 +359,7 @@ async def wangke120(sess: requests.Session,
359359
except requests.exceptions.RequestException as e:
360360
logging.info("Request Exception appeared: %s" % e)
361361
answer = []
362-
answer.append({'topic': utils.decode_uri_component(e),
362+
answer.append({'topic': utils.decode_uri_component(str(e)),
363363
'correct': ''})
364364
index = yield answer
365365
continue

app.py

+33-1
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,43 @@ def _unscroll_text(event):
100100
frame3 = Frame(self.root, style='White.TFrame')
101101
frame3.pack(side=BOTTOM, fill=X)
102102
button1 = Button(frame3, text="查询", command=self.start_search, style='TButton')
103-
button1.pack(side=TOP)
103+
button1.pack(side=LEFT, expand=True)
104+
105+
button2 = Button(frame3, text="加入我们", command=self.contact_us, style='TButton')
106+
button2.pack(side=RIGHT)
104107

105108
self.root.update()
106109
self.root.mainloop()
107110

111+
def contact_us(self):
112+
top = Toplevel(self.root)
113+
top.geometry('350x150')
114+
top.resizable(False, False)
115+
frame = Frame(top)
116+
frame.pack(fill=BOTH)
117+
118+
Label(frame, text="全自动插件下载/作者:CodFrm").pack()
119+
self.plugin = StringVar()
120+
self.plugin.set("https://github.com/CodFrm/cxmooc-tools/releases")
121+
entry1 = Entry(frame, width=50, textvariable=self.plugin)
122+
entry1.pack()
123+
entry1['state'] = "readonly"
124+
125+
Label(frame, text="本软件更新下载地址/作者:Joker").pack()
126+
self.download = StringVar()
127+
self.download.set("https://github.com/yanyongyu/CXmoocSearchTool/releases")
128+
entry2 = Entry(frame, width=50, textvariable=self.download)
129+
entry2.pack()
130+
entry2['state'] = "readonly"
131+
132+
Label(frame, text="QQ群号:").pack(side=LEFT)
133+
self.qq = StringVar()
134+
self.qq.set("614202391")
135+
entry3 = Entry(frame, textvariable=self.qq)
136+
entry3.pack(side=LEFT)
137+
entry3['state'] = "readonly"
138+
139+
108140
def start_search(self):
109141
text = self.text1.get(1.0, END).strip(' \n\r').split('\n')
110142
logging.info("Text get: %s" % text)

0 commit comments

Comments
 (0)