a semiworking version, line 343 in gui.py is commented cuz it needs work, the table is also a bit screwed

This commit is contained in:
nosch
2026-03-07 19:30:24 +01:00
parent c76d179daa
commit 003dd0e3aa
7 changed files with 121 additions and 158 deletions
+2 -22
View File
@@ -17,14 +17,13 @@ class AppState(QObject):
self.currenttracker: str = "rutracker"
self.trackertable: QTableWidget
self.trackers: Dict[str,Dict[str,Any]] # each tracker should add itself here, will be listed in order of module initialisation
self.trackers: Dict[str,Dict[str,Any]] = {}# each tracker should add itself here
'''
an example:
"rutracker" : {
"name" : "rutracker", # name of the tracker
"posts" : [post1, post2, ...], # all the posts, will be in self.posts,
"headers" : ["author", "title"], # keys shown in the table
"sortkey" : "name" # the key to sort posts by # currently only usefull to steamrip
"scrapeFunc" : function,
}
'''
self.api_url: str = "https://api.michijackson.xyz"
@@ -42,25 +41,6 @@ class AppState(QObject):
self.active_interfaces: List = []
self.bound_interface: Any = None
def update_tracker_table(self, newtracker: str):
if newtracker not in self.trackers.keys():
raise ValueError("the selected tracker is not initialised.")
self.trackertable.setColumnCount(self.trackers[self.currenttracker][])
for row_index, row_data in enumerate(self.trackers[self.currenttracker].values()):
for col_index, key in enumerate(row_data.keys()):
if key in self.trackers[self.currenttracker]["ignorekeys"]:
continue
value = row_data.get(key, "")
self.trackertable.setItem(
row_index,
col_index,
QtWidgets.QTableWidgetItem(value)
)
@property
def image_path(self) -> str:
return self._image_path