Skip to content

Commit

Permalink
aviod wire delay
Browse files Browse the repository at this point in the history
  • Loading branch information
amluckydave committed Nov 30, 2019
1 parent 647dac7 commit 605a386
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- mode: python ; coding: utf-8 -*-

block_cipher = None


a = Analysis(['linkSHU.py'],
pathex=['F:\\linkSHU (alpha)'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False , icon='logo.ico')
7 changes: 5 additions & 2 deletions ruijie.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@


class shuConnect:
def __init__(self, user=0, passwd='shu'):
def __init__(self, user=0, passwd='shu', chose=1):
self.user = user
self.passwd = passwd
self.chose = chose

def precheck_connect(self):
try:
Expand Down Expand Up @@ -73,7 +74,9 @@ def connect(self):
return False, resp["message"]

def start_connect(self):
sleep(1) # 不延时,precheck 中 sock.connect 反应不过来
if self.chose != 1:
sleep(1) # 不延时,precheck 中 sock.connect 反应不过来

status = self.check_connect()
if status == 1:
s = '已认证 & 用户已在线 \n'
Expand Down
2 changes: 1 addition & 1 deletion wifiConnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def run(self):
sleep(1) # 不延时,wifi反应不过来

s0 = "Shu(ForAll) 连接成功\n"
shu = shuConnect(self.user, self.passwd)
shu = shuConnect(self.user, self.passwd, chose=2)
s = s0 + shu.start_connect()

except:
Expand Down

0 comments on commit 605a386

Please sign in to comment.