Skip to content

Commit

Permalink
refactor(update_check): add DEBUG flag for conditional logging of win…
Browse files Browse the repository at this point in the history
…get output format errors
  • Loading branch information
amnweb committed Dec 16, 2024
1 parent 77ad97f commit 77dfb83
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/widgets/yasb/update_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from PyQt6.QtWidgets import QLabel, QHBoxLayout, QWidget
from PyQt6.QtCore import Qt, QThread, pyqtSignal
import win32com.client
from settings import DEBUG

class UpdateWorker(QThread):
windows_update_signal = pyqtSignal(dict)
Expand Down Expand Up @@ -65,7 +66,8 @@ def run(self):
fl += 1

if fl >= len(lines):
logging.error("Invalid winget output format.")
if DEBUG:
logging.warning("Invalid winget output format.")
self.winget_update_signal.emit({"count": 0, "names": []})
return

Expand Down

0 comments on commit 77dfb83

Please sign in to comment.