support supported versions that start with v
All checks were successful
Actions / Lint Code (Ruff & Pylint) (push) Successful in 10s
Actions / Build Package (push) Successful in 17s

This commit is contained in:
Seaswimmer 2024-11-14 14:06:31 -05:00
parent 18bcfe5f92
commit 5c5019dbce
Signed by: cswimr
GPG key ID: A9C162E867C851FA
2 changed files with 5 additions and 3 deletions

View file

@ -1,6 +1,6 @@
[project] [project]
name = "stellarismodparser" name = "stellarismodparser"
version = "1.0.6" version = "1.0.7"
authors = [ authors = [
{ name="cswimr", email="seaswimmerthefsh@gmail.com" }, { name="cswimr", email="seaswimmerthefsh@gmail.com" },
] ]

View file

@ -106,11 +106,13 @@ class Mod:
supported_version: Optional[StellarisVersion] = None supported_version: Optional[StellarisVersion] = None
remote_file_id: Optional[int] = None remote_file_id: Optional[int] = None
def __post_init__(self): def __post_init__(self) -> None:
if self.tags and len(self.tags) > 10: if self.tags and len(self.tags) > 10:
logger.warning("Mod %s has more than 10 tags. This will prevent the mod from being uploaded to the Steam Workshop and Paradox Mods.", self.name) logger.warning("Mod %s has more than 10 tags. This will prevent the mod from being uploaded to the Steam Workshop and Paradox Mods.", self.name)
if self.supported_version and isinstance(self.supported_version, str): if self.supported_version and isinstance(self.supported_version, str):
self.supported_version = StellarisVersion.parse(self.supported_version) if self.supported_version.startswith("v"):
self.supported_version = self.supported_version[1:]
self.supported_version = StellarisVersion.parse(version=self.supported_version)
def __str__(self) -> str: def __str__(self) -> str:
return self.name return self.name