bug fixes for updates

This commit is contained in:
ingvar1995 2017-07-03 21:36:11 +03:00
parent 8d0426f775
commit c21e39b158
2 changed files with 11 additions and 4 deletions

View File

@ -57,7 +57,10 @@ def get_url(version):
def get_params(url, version):
if is_from_sources():
return ['python3', 'toxygen_updater.py', url, version]
if platform.system() == 'Windows':
return ['python', 'toxygen_updater.py', url, version]
else:
return ['python3', 'toxygen_updater.py', url, version]
elif platform.system() == 'Windows':
return [util.curr_directory() + '/toxygen_updater.exe', url, version]
else:
@ -87,7 +90,8 @@ def send_request(version):
netman.setProxy(proxy)
url = test_url(version)
try:
request = QtNetwork.QNetworkRequest(url)
request = QtNetwork.QNetworkRequest()
request.setUrl(QtCore.QUrl(url))
reply = netman.get(request)
while not reply.isFinished():
QtCore.QThread.msleep(1)

View File

@ -22,8 +22,11 @@ def cached(func):
def log(data):
with open(curr_directory() + '/logs.log', 'a') as fl:
fl.write(str(data) + '\n')
try:
with open(curr_directory() + '/logs.log', 'a') as fl:
fl.write(str(data) + '\n')
except:
pass
@cached