mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 17:59:43 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user