Refactor authors property #20

Open
Toast wants to merge 1 commit from authorsRefactor into main
2 changed files with 3 additions and 3 deletions
Showing only changes of commit d5ebb6dba4 - Show all commits

View file

@ -48,12 +48,12 @@ class Mod:
return None return None
@property @property
def authors(self) -> list[str] | None: def authors(self) -> list[str]:
if self.__has_meta_json: if self.__has_meta_json:
if "authors" in self.__meta: if "authors" in self.__meta:
return self.__meta.get("authors", list[str]) return self.__meta.get("authors", list[str])
if "author" not in self.__config: if "author" not in self.__config:
return None return []
return [self.__config.get("author", str)] return [self.__config.get("author", str)]
@property @property

View file

@ -41,7 +41,7 @@ class QMod(QObject):
return self.__mod.long_description return self.__mod.long_description
@Property(list, constant=True) @Property(list, constant=True)
def authors(self) -> list[str] | None: def authors(self) -> list[str]:
return self.__mod.authors return self.__mod.authors
mod_enabled = Signal(name="enabled") mod_enabled = Signal(name="enabled")