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,6 +57,9 @@ def get_url(version):
def get_params(url, version): def get_params(url, version):
if is_from_sources(): if is_from_sources():
if platform.system() == 'Windows':
return ['python', 'toxygen_updater.py', url, version]
else:
return ['python3', 'toxygen_updater.py', url, version] 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]
@ -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):
try:
with open(curr_directory() + '/logs.log', 'a') as fl: with open(curr_directory() + '/logs.log', 'a') as fl:
fl.write(str(data) + '\n') fl.write(str(data) + '\n')
except:
pass
@cached @cached