wip: http backend with callbacks

..currently all callbacks are executed non-async for testing
..they may be bugs with async downloads not correctly being waited for
..there may be problems with binding changing variables correctly
This commit is contained in:
Yannik Schmidt
2025-01-13 22:47:28 +01:00
parent f46fce1824
commit df3ea69efb
6 changed files with 73 additions and 20 deletions

View File

@@ -26,13 +26,19 @@ class Software:
self.invalid = False
self._load_from_yaml()
except ValueError as e:
print(e)
raise e
self.invalid = True
if not progress_bar_wrapper:
raise AssertionError()
self.progress_bar_wrapper = progress_bar_wrapper
def _load_from_yaml(self):
content = self.backend.get(self.meta_file, self.cache_dir, return_content=True)
# print("Meta-Content:", content)
meta = yaml.safe_load(content)
if not meta:
@@ -50,9 +56,14 @@ class Software:
self.pictures = [ self.backend.get(pp, self.cache_dir) for pp in
self.backend.list(os.path.join(self.directory, "pictures"), fullpaths=True) ]
if any([x is None for x in self.pictures]):
raise AssertionError("None Entries in self.pictures: " + str(self.pictures))
self.reg_files = self.backend.list(os.path.join(self.directory, "registry_files"), fullpaths=True)
print("Finished Init for", self.title)
def get_thumbnail(self):
'''Return the thumbnail for this software'''