mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 01:49:42 +02:00
feat: enhance error handling and logging in various modules; improve timeout settings for network requests / fix basic issues
This commit is contained in:
@@ -224,8 +224,6 @@ def settings_dialog(self):
|
||||
else:
|
||||
interface_select.setCurrentIndex(0)
|
||||
|
||||
interface_select.setFixedWidth(180)
|
||||
interface_select.setFixedHeight(30)
|
||||
interface_select.setFixedWidth(180)
|
||||
interface_select.setFixedHeight(30)
|
||||
interface_layout.addWidget(interface_select)
|
||||
|
||||
@@ -30,7 +30,6 @@ import libtorrent as lt
|
||||
import sys
|
||||
import json
|
||||
import base64
|
||||
import winreg
|
||||
from core.utils.logging.logs import consoleLog, remove_download_log, flush_log_buffer
|
||||
from core.utils.general.wrappers import run_thread
|
||||
from core.utils.data.state import state
|
||||
@@ -157,17 +156,13 @@ def download_update(latest_version):
|
||||
response = r.get(url, allow_redirects=True, stream=True)
|
||||
total = int(response.headers.get("content-length", 0))
|
||||
downloaded = 0
|
||||
chunks = []
|
||||
for chunk in response.iter_content(chunk_size=65536):
|
||||
chunks.append(chunk)
|
||||
downloaded += len(chunk)
|
||||
if total > 0:
|
||||
progress.setValue(int(downloaded * 100 / total))
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
with open(installer_path, "wb") as f:
|
||||
for chunk in chunks:
|
||||
for chunk in response.iter_content(chunk_size=65536):
|
||||
f.write(chunk)
|
||||
downloaded += len(chunk)
|
||||
if total > 0:
|
||||
progress.setValue(int(downloaded * 100 / total))
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
if not os.path.exists(installer_path):
|
||||
progress.close()
|
||||
|
||||
@@ -50,7 +50,7 @@ def return_pressed(self):
|
||||
|
||||
elif state.tracker is not None:
|
||||
state.posts = scrapers[state.tracker](search_text)
|
||||
if state.posts == []:
|
||||
if not state.posts:
|
||||
consoleLog(f"No Results for {search_text}")
|
||||
state.tracker_list[state.tracker].clear()
|
||||
self.show_empty_results(True)
|
||||
|
||||
Reference in New Issue
Block a user