Get metadata from meta.json, if it exists #12
2 changed files with 12 additions and 0 deletions
|
|
@ -41,6 +41,12 @@ class Mod:
|
||||||
else:
|
else:
|
||||||
return self.__config.get("description", str)
|
return self.__config.get("description", str)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def long_description(self) -> str | None:
|
||||||
|
if "descriptionLong" in self.__meta:
|
||||||
|
return self.__meta.get("descriptionLong", str)
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def author(self) -> str | None:
|
def author(self) -> str | None:
|
||||||
# TODO: return list with authors
|
# TODO: return list with authors
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ QML_IMPORT_NAME = "Leek"
|
||||||
QML_IMPORT_MAJOR_VERSION = 1
|
QML_IMPORT_MAJOR_VERSION = 1
|
||||||
|
|
||||||
|
|
||||||
|
# Qt follows C++ naming conventions
|
||||||
|
# ruff: noqa: N802
|
||||||
@QmlElement
|
@QmlElement
|
||||||
@QmlUncreatable("QMod is intended to be returned by a QModListModel")
|
@QmlUncreatable("QMod is intended to be returned by a QModListModel")
|
||||||
class QMod(QObject):
|
class QMod(QObject):
|
||||||
|
|
@ -34,6 +36,10 @@ class QMod(QObject):
|
||||||
def description(self) -> str | None:
|
def description(self) -> str | None:
|
||||||
return self.__mod.description
|
return self.__mod.description
|
||||||
|
|
||||||
|
@Property(str, constant=True)
|
||||||
|
def longDescription(self) -> str | None:
|
||||||
|
return self.__mod.long_description
|
||||||
|
|
||||||
mod_enabled = Signal(name="enabled")
|
mod_enabled = Signal(name="enabled")
|
||||||
|
|
||||||
@Property(bool, notify=mod_enabled)
|
@Property(bool, notify=mod_enabled)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue