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

View File

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