Skip to content

Commit

Permalink
Update to v1.2.5-rc2
Browse files Browse the repository at this point in the history
* Enable updating the masterlist by default
* Fix masterlist being loaded from the wrong location
* Improve version comparisons in LOOT condition strings
  • Loading branch information
JonathanFeenstra committed Aug 5, 2023
1 parent fe0933b commit e83e660
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
4 changes: 2 additions & 2 deletions LOOT-Warning-Checker/CheckerPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def description(self) -> str:
return self.__tr("Checks for LOOT warnings.")

def version(self) -> mobase.VersionInfo:
return mobase.VersionInfo(1, 2, 5, mobase.ReleaseType.CANDIDATE)
return mobase.VersionInfo(1, 2, 5, 2, mobase.ReleaseType.CANDIDATE)

def requirements(self) -> List[mobase.IPluginRequirement]:
return [mobase.PluginRequirementFactory.gameDependency(games=list(SUPPORTED_GAMES.keys()))]
Expand All @@ -70,7 +70,7 @@ def settings(self) -> List[mobase.PluginSetting]:
mobase.PluginSetting(
"auto-update-masterlist",
self.__tr("Automatically update the LOOT masterlist on launch"),
False,
True,
),
mobase.PluginSetting(
"include-info-messages",
Expand Down
10 changes: 5 additions & 5 deletions LOOT-Warning-Checker/tools/LOOT/Conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
GPL License and Copyright Notice ============================================
Parts of this file are based on code from Wrye Bash:
https://github.com/wrye-bash/wrye-bash/blob/dev/Mopy/bash/bosh/loot_conditions.py
https://github.com/wrye-bash/wrye-bash/blob/dev/Mopy/bash/loot_conditions.py
Wrye Bash is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License
Expand All @@ -40,7 +40,7 @@
You should have received a copy of the GNU General Public License
along with Wrye Bash. If not, see <https://www.gnu.org/licenses/>.
Wrye Bash copyright (C) 2005-2009 Wrye, 2010-2022 Wrye Bash Team
Wrye Bash copyright (C) 2005-2009 Wrye, 2010-2023 Wrye Bash Team
https://github.com/wrye-bash
=============================================================================
Expand Down Expand Up @@ -547,16 +547,16 @@ def _version(
if os.path.isfile(absolutePath):
if extension in (".exe", ".dll"):
# "If filepath does not exist or does not have a version number, its version is assumed to be 0"
actualVersion = mobase.getFileVersion(absolutePath) or "0.0.0.0"
actualVersion = mobase.VersionInfo(mobase.getFileVersion(absolutePath) or "0.0.0.0")
elif extension in (".esp", ".esm", ".esl"):
if origins := self._organizer.getFileOrigins(relativeFilePath):
mod = self._organizer.modList().getMod(origins[0])
actualVersion = mod.version().canonicalString()
actualVersion = mod.version()
else:
return False
else:
raise InvalidConditionError(f"{relativeFilePath} is not a valid binary or plugin file.")
return comparisonOperator(actualVersion, givenVersion)
return comparisonOperator(actualVersion, mobase.VersionInfo(givenVersion))
return False

def _productVersion(
Expand Down
12 changes: 7 additions & 5 deletions LOOT-Warning-Checker/tools/LOOT/Masterlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
MissingRequirementWarning,
)

CHECKER_PLUGIN_NAME: Final[str] = "LOOT Warning Checker"
_CHECKER_PLUGIN_NAME: Final[str] = "LOOT Warning Checker"


class LOOTGame(NamedTuple):
Expand Down Expand Up @@ -311,7 +311,9 @@ def _loadLists(self) -> _LOOTMasterlist:
Returns:
_LOOTMasterlist: Parsed masterlist data
"""
masterlistPath = getMasterlistPath(self._organizer.getPluginDataPath(), self._game.folder)
masterlistPath = getMasterlistPath(
os.path.join(self._organizer.getPluginDataPath(), _CHECKER_PLUGIN_NAME), self._game.folder
)
if not os.path.isfile(masterlistPath):
qDebug(f"Masterlist not found at {masterlistPath}, downloading...")
try:
Expand Down Expand Up @@ -341,10 +343,10 @@ def _loadLists(self) -> _LOOTMasterlist:
return masterlist

def _getUserlistPath(self) -> str:
userlistsDir = self._organizer.pluginSetting(CHECKER_PLUGIN_NAME, "userlists-directory")
userlistsDir = self._organizer.pluginSetting(_CHECKER_PLUGIN_NAME, "userlists-directory")
if userlistsDir == "":
userlistsDir = os.path.join(self._organizer.getPluginDataPath(), CHECKER_PLUGIN_NAME)
self._organizer.setPluginSetting(CHECKER_PLUGIN_NAME, "userlists-directory", userlistsDir)
userlistsDir = os.path.join(self._organizer.getPluginDataPath(), _CHECKER_PLUGIN_NAME)
self._organizer.setPluginSetting(_CHECKER_PLUGIN_NAME, "userlists-directory", userlistsDir)
return os.path.join(userlistsDir, self._game.folder, "userlist.yaml")

def getWarnings(self, includeInfo: bool = False) -> Generator[LOOTWarning, None, None]:
Expand Down
18 changes: 18 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,24 @@
"DataPath": [
"data/LOOT Warning Checker"
]
},
{
"Version": "1.2.5-rc2",
"Released": "2023-08-05",
"MinSupport": "2.4.4",
"MaxSupport": "2.4.4",
"DownloadUrl": "https://github.com/JonathanFeenstra/modorganizer-loot-warning-checker/releases/download/v1.2.5-rc2/LOOT-Warning-Checker-v1.2.5-rc2.zip",
"PluginPath": [
"LOOT-Warning-Checker"
],
"ReleaseNotes": [
"Enable updating the masterlist by default",
"Fix masterlist being loaded from the wrong location",
"Improve version comparisons in LOOT condition strings"
],
"DataPath": [
"data/LOOT Warning Checker"
]
}
]
}

0 comments on commit e83e660

Please sign in to comment.