updater bug fixes

This commit is contained in:
St.Huang 2018-08-02 11:01:26 +08:00
parent e44d826cb0
commit 484740bb50
2 changed files with 20 additions and 12 deletions

View File

@ -115,12 +115,16 @@ def updateSingle(repositories, path, data):
code = asset['url'] code = asset['url']
p, fname = os.path.split(code) p, fname = os.path.split(code)
appendHtml(temp='<br />Downloading {1}: {0}%<br/>'.format(0,fname)) appendHtml(temp='<br />Downloading {1}: {0}%<br/>'.format(0,fname))
urlthread = UrlThread(code) try:
urlthread.start() urlthread = UrlThread(code)
urlthread.join() urlthread.start()
response = urlthread.response#urllib2.urlopen(code) urlthread.join()
meta = response.info() response = urlthread.response#urllib2.urlopen(code)
file_size = int(meta.get("Content-Length")) meta = response.info()
file_size = int(meta.get("Content-Length"))
except:
appendHtml('Downloading file error!<br/>')
return
d = buffer('') d = buffer('')
dl = 0 dl = 0
i = 0 i = 0

View File

@ -115,12 +115,16 @@ def updateSingle(repositories, path, data):
code = asset['url'] code = asset['url']
p, fname = os.path.split(code) p, fname = os.path.split(code)
appendHtml(temp='<br />Downloading {1}: {0}%<br/>'.format(0,fname)) appendHtml(temp='<br />Downloading {1}: {0}%<br/>'.format(0,fname))
urlthread = UrlThread(code) try:
urlthread.start() urlthread = UrlThread(code)
urlthread.join() urlthread.start()
response = urlthread.response#urllib2.urlopen(code) urlthread.join()
meta = response.info() response = urlthread.response#urllib2.urlopen(code)
file_size = int(meta.get("Content-Length")) meta = response.info()
file_size = int(meta.get("Content-Length"))
except:
appendHtml('Downloading file error!<br/>')
return
d = b'' d = b''
dl = 0 dl = 0
i = 0 i = 0