Skip to content

Commit

Permalink
Update LOOT masterlist version to v0.21
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanFeenstra committed Sep 17, 2023
1 parent e83e660 commit d917fd3
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
echo "EOF" >> $env:GITHUB_ENV
- run: |
echo "RELEASE_NOTES<<EOF" >> $env:GITHUB_ENV
echo $env:RELEASE_NOTES -split "\n" | foreach {"* " + $_} >> $env:GITHUB_ENV
echo $env:RELEASE_NOTES | foreach {"* " + $_} >> $env:GITHUB_ENV
echo "EOF" >> $env:GITHUB_ENV
if: ${{ env.RELEASE_NOTES }} =~ '*\n*'
- name: Zip
Expand Down
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, 2, mobase.ReleaseType.CANDIDATE)
return mobase.VersionInfo(1, 2, 5, 3, release_type=mobase.ReleaseType.CANDIDATE)

def requirements(self) -> List[mobase.IPluginRequirement]:
return [mobase.PluginRequirementFactory.gameDependency(games=list(SUPPORTED_GAMES.keys()))]
Expand Down Expand Up @@ -210,7 +210,7 @@ def __resolve_xEditExecutablePath(self, game: xEditGame) -> Optional[str]:
path = self.__start_xEditDirectorySelectionDialog(game)

if path is not None and os.path.isfile(path):
self.__organizer.setPluginSetting(self.name(), "xedit-directory", os.path.dirname(path))
self.__organizer.setPluginSetting(self.name(), "xedit-directory", os.path.normpath(os.path.dirname(path)))
return path

def __start_xEditDirectorySelectionDialog(self, game: xEditGame) -> Optional[str]:
Expand Down
1 change: 1 addition & 0 deletions LOOT-Warning-Checker/Games.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class GameType(NamedTuple):
"Skyrim": GameType(xEditGame("xTES", "TES5"), LOOTGame("skyrim", "Skyrim")),
"Skyrim Special Edition": GameType(xEditGame("xTES", "SSE"), LOOTGame("skyrimse", "Skyrim Special Edition")),
"Skyrim VR": GameType(xEditGame("xTES", "TES5VR"), LOOTGame("skyrimvr", "Skyrim VR")),
"Starfield": GameType(xEditGame("xSF", "SF1"), LOOTGame("starfield", "Starfield")),
"Enderal": GameType(xEditGame("xTES", "Enderal"), LOOTGame("skyrim", "Enderal")),
"Enderal Special Edition": GameType(
xEditGame("xTES", "EnderalSE"),
Expand Down
1 change: 0 additions & 1 deletion LOOT-Warning-Checker/tools/LOOT/Conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
References:
- https://loot-api.readthedocs.io/en/latest/metadata/conditions.html
- https://loot.github.io/docs/0.9.2/LOOT%20Metadata%20Syntax.html#cond
Copyright (C) 2021-2023 Jonathan Feenstra
Expand Down
21 changes: 10 additions & 11 deletions LOOT-Warning-Checker/tools/LOOT/Masterlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def merge(self, other: "_LOOTMasterlist") -> None:
Currently only merges data used by the MO2 plugin.
https://loot.github.io/docs/0.9.2/LOOT%20Metadata%20Syntax.html#structs-plugin-merge
https://loot-api.readthedocs.io/en/stable/metadata/data_structures/plugin.html#merging-behaviour
Args:
other (_LOOTMasterlist): Masterlist to merge into this one
Expand All @@ -155,7 +155,7 @@ def merge(self, other: "_LOOTMasterlist") -> None:
def _mergeEntry(entry1: Dict[str, Any], entry2: Dict[str, Any]) -> None:
"""Merge the given masterlist entries.
https://loot.github.io/docs/0.9.2/LOOT%20Metadata%20Syntax.html#structs-file
https://loot-api.readthedocs.io/en/stable/metadata/data_structures/file.html
Args:
entry1 (Dict[str, Any]): First masterlist entry
Expand All @@ -174,7 +174,7 @@ def _mergeEntry(entry1: Dict[str, Any], entry2: Dict[str, Any]) -> None:
def _mergeFileSets(masterFileSet: List[Union[str, Dict]], userFileSet: List[Union[str, Dict]]) -> List[Union[str, Dict]]:
"""Merge the masterlist and userlist file sets.
https://loot.github.io/docs/0.9.2/LOOT%20Metadata%20Syntax.html#structs-file
https://loot-api.readthedocs.io/en/stable/metadata/data_structures/file.html
Args:
masterFileSet ([List[Union[str, Dict]]]): Parsed masterlist file set
Expand Down Expand Up @@ -211,7 +211,7 @@ def _mergeMessageLists(
) -> List[Dict[str, Any]]:
"""Merge the masterlist and userlist message lists.
https://loot.github.io/docs/0.9.2/LOOT%20Metadata%20Syntax.html#structs-message
https://loot-api.readthedocs.io/en/stable/metadata/data_structures/message.html
Args:
masterMessageList (List[Dict[str, Any]]): Parsed masterlist message list
Expand All @@ -231,7 +231,7 @@ def _mergeDirtyInfoSets(
) -> List[Dict[str, Any]]:
"""Merge the masterlist and userlist dirty info sets.
https://loot.github.io/docs/0.9.2/LOOT%20Metadata%20Syntax.html#structs-dirty
https://loot-api.readthedocs.io/en/stable/metadata/data_structures/cleaning.html
Args:
masterDirtyInfoSet (List[Dict[str, Any]]): Parsed masterlist dirty info set
Expand Down Expand Up @@ -285,7 +285,7 @@ def downloadMasterlist(masterlistRepo: str, filePath: Union[str, os.PathLike]) -
OSError: If the file cannot be written to
"""
# Version branch may change if the masterlist syntax changes
masterlistURL = f"https://raw.githubusercontent.com/loot/{masterlistRepo}/v0.18/masterlist.yaml"
masterlistURL = f"https://raw.githubusercontent.com/loot/{masterlistRepo}/v0.21/masterlist.yaml"
with urlopen(masterlistURL) as response:
with open(filePath, "wb") as file:
file.write(response.read())
Expand Down Expand Up @@ -346,7 +346,7 @@ def _getUserlistPath(self) -> str:
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)
self._organizer.setPluginSetting(_CHECKER_PLUGIN_NAME, "userlists-directory", os.path.normpath(userlistsDir))
return os.path.join(userlistsDir, self._game.folder, "userlist.yaml")

def getWarnings(self, includeInfo: bool = False) -> Generator[LOOTWarning, None, None]:
Expand Down Expand Up @@ -421,7 +421,7 @@ def _getMissingRequirementWarnings(
continue
yield MissingRequirementWarning(plugin.name, file)
else:
# file datastructure: https://loot.github.io/docs/0.9.2/LOOT%20Metadata%20Syntax.html#structs-file
# file datastructure: https://loot-api.readthedocs.io/en/stable/metadata/data_structures/file.html
fileName = file["name"]
if self._conditionEvaluator._file(fileName):
continue
Expand Down Expand Up @@ -451,7 +451,7 @@ def _getIncompatibilityWarnings(
if self._conditionEvaluator._file(file):
yield IncompatibilityWarning(plugin.name, file)
else:
# file datastructure: https://loot.github.io/docs/0.9.2/LOOT%20Metadata%20Syntax.html#structs-file
# file datastructure: https://loot-api.readthedocs.io/en/stable/metadata/data_structures/file.html
fileName = file["name"]
if self._conditionEvaluator._file(fileName):
if (condition := file.get("condition")) is not None:
Expand All @@ -469,7 +469,6 @@ def _getMessageWarnings(
"""Get LOOT warnings for messages.
https://loot-api.readthedocs.io/en/latest/metadata/data_structures/message.html
https://loot.github.io/docs/0.9.2/LOOT%20Metadata%20Syntax.html#structs-message
Args:
plugin (GamebryoPlugin): The plugin to check for messages
Expand All @@ -496,7 +495,7 @@ def _getDirtyWarnings(
) -> Generator[DirtyPluginWarning, None, None]:
"""Get LOOT warnings for dirty plugins.
https://loot.github.io/docs/0.9.2/LOOT%20Metadata%20Syntax.html#structs-dirty
https://loot-api.readthedocs.io/en/stable/metadata/data_structures/cleaning.html
Args:
plugin (GamebryoPlugin): Plugin to check
Expand Down
3 changes: 1 addition & 2 deletions LOOT-Warning-Checker/tools/LOOT/Warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ def __init__(self, pluginName: str, msgData: Dict[str, Union[str, List]]) -> Non
# content[0] = English localization
content = content[0]["text"] if isinstance(content, list) else content
if subs := msgData.get("subs", []):
for idx, sub in enumerate(subs):
content = content.replace(f"%{idx + 1}%", sub)
content = content.format(*subs)
self.fullDescription = f"{pluginName}: {_convertMarkdownToHTML(content)}"
self.shortDescription = f"{pluginName}: {_stripMarkdown(content)}"

Expand Down
16 changes: 16 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,22 @@
"DataPath": [
"data/LOOT Warning Checker"
]
},
{
"Version": "1.2.5-rc3",
"Released": "2023-09-17",
"MinSupport": "2.4.4",
"MaxSupport": "2.4.4",
"DownloadUrl": "https://github.com/JonathanFeenstra/modorganizer-loot-warning-checker/releases/download/v1.2.5-rc3/LOOT-Warning-Checker-v1.2.5-rc3.zip",
"PluginPath": [
"LOOT-Warning-Checker"
],
"ReleaseNotes": [
"Update LOOT masterlist version to v0.21"
],
"DataPath": [
"data/LOOT Warning Checker"
]
}
]
}

0 comments on commit d917fd3

Please sign in to comment.