qt update checker: handle --offline
This commit is contained in:
@@ -936,11 +936,18 @@ class UpdateCheckThread(QThread, PrintError):
|
|||||||
return StrictVersion(version_num.strip())
|
return StrictVersion(version_num.strip())
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
try:
|
network = self.main_window.network
|
||||||
self.checked.emit(asyncio.run_coroutine_threadsafe(self.get_update_info(), self.main_window.network.asyncio_loop).result())
|
if not network:
|
||||||
except Exception:
|
|
||||||
self.print_error(traceback.format_exc())
|
|
||||||
self.failed.emit()
|
self.failed.emit()
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
update_info = asyncio.run_coroutine_threadsafe(self.get_update_info(), network.asyncio_loop).result()
|
||||||
|
except Exception as e:
|
||||||
|
#self.print_error(traceback.format_exc())
|
||||||
|
self.print_error(f"got exception: '{repr(e)}'")
|
||||||
|
self.failed.emit()
|
||||||
|
else:
|
||||||
|
self.checked.emit(update_info)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user