mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
Refactor scrape_uztracker call in GUI to handle no results more gracefully and improve debug output
This commit is contained in:
+11
-4
@@ -122,12 +122,19 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
||||
|
||||
def return_pressed(self):
|
||||
search_text = self.searchbar.text()
|
||||
self.postnames, self.postlinks = scrape_uztracker(search_text, debug)
|
||||
self.softwareList.clear()
|
||||
if self.postnames:
|
||||
self.softwareList.addItems(self.postnames)
|
||||
if debug:
|
||||
print("User searched for:", search_text)
|
||||
|
||||
response = scrape_uztracker(search_text, debug)
|
||||
if response:
|
||||
self.postnames, self.postlinks = response
|
||||
self.softwareList.clear()
|
||||
if self.postnames:
|
||||
self.softwareList.addItems(self.postnames)
|
||||
elif debug:
|
||||
print(f"No Results found for \"{search_text}\"")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user