@@ -33,6 +33,7 @@ def login(self):
3333 class NoRedirHandler (urllib .request .HTTPRedirectHandler ):
3434 def http_error_302 (self , req , fp , code , msg , headers ):
3535 return fp
36+
3637 http_error_301 = http_error_302
3738
3839 print ('正在登录...' )
@@ -150,7 +151,10 @@ def run(self):
150151 self .login ()
151152 break
152153 except Exception as e :
154+ < << << << Updated upstream
153155 print (datetime .now ().strftime ('%Y-%m-%d %H:%M:%S' ))
156+ == == == =
157+ >> >> >> > Stashed changes
154158 if '由于目标计算机积极拒绝,无法连接。' in str (e ) or 'Errno 111' in str (e ):
155159 print ('一网通已关闭,正在重试...' )
156160 sleep (2 )
@@ -205,7 +209,11 @@ def win_run():
205209 print ('开始时间小于当前时间' )
206210 return
207211 self .max_site = int (yysc_inp .get ())
212+ < << << << Updated upstream
208213 self .shopNum = '1001' if value1 .get () == '西丽湖' else '1002'
214+ == == == =
215+ self .shopNum = '1001' if value1 .get () == '西丽湖' else self .shopNum = '1002'
216+ >> >> >> > Stashed changes
209217 self .post_type = value2 .get ()
210218 if self .shopNum == '1001' :
211219 self .shopName = 'xlh' + self .post_dict [self .post_type ]
@@ -322,7 +330,7 @@ def linux_run(self):
322330 max_site = 3 # 最多预约几小时(最多3小时)
323331 shopNum = '1001' # 西丽湖:1001 留仙洞:1002
324332 post_type = '羽毛球' # 羽毛球, 健身中心, 游泳, 风雨篮球, 灯光篮球, 网球, 体能中心
325- run_type = 1 # 1:Windows端 2:Linux端
333+ run_type = 2 # 1:Windows端 2:Linux端
326334 main = Ydsz (username , password , day , starttime , endtime , max_site , shopNum , post_type )
327335 main .win_box () if run_type == 1 else main .linux_run ()
328336 input ('程序结束,按回车键退出' )
0 commit comments