mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-05 04:08:21 +02:00
safe_eval now has mod_config in the environnement
This commit is contained in:
parent
cf0f61d8ee
commit
cb069fe240
2 changed files with 11 additions and 4 deletions
|
@ -44,4 +44,4 @@ class ExtractedGame:
|
|||
# for all the subdirectory named "_PATCH", apply the patch
|
||||
for part_directory in mod_config.get_mod_directory().glob("[!_]*"):
|
||||
for patch_directory in part_directory.glob("_PATCH/"):
|
||||
yield from Patch(patch_directory).install(self)
|
||||
yield from Patch(patch_directory, mod_config).install(self)
|
||||
|
|
|
@ -9,8 +9,9 @@ class Patch:
|
|||
Represent a patch object
|
||||
"""
|
||||
|
||||
def __init__(self, path: Path | str):
|
||||
def __init__(self, path: Path | str, mod_config: "ModConfig"):
|
||||
self.path = Path(path)
|
||||
self.mod_config = mod_config
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"<{self.__class__.__name__} {self.path}>"
|
||||
|
@ -24,8 +25,14 @@ class Patch:
|
|||
"""
|
||||
return safe_eval(
|
||||
template,
|
||||
extra_token_map={"extracted_game": "extracted_game"},
|
||||
env={"extracted_game": extracted_game},
|
||||
extra_token_map={
|
||||
"extracted_game": "extracted_game",
|
||||
"mod_config": "mod_config"
|
||||
},
|
||||
env={
|
||||
"extracted_game": extracted_game,
|
||||
"mod_config": self.mod_config
|
||||
},
|
||||
)
|
||||
|
||||
def install(self, extracted_game: "ExtractedGame") -> Generator[dict, None, None]:
|
||||
|
|
Loading…
Reference in a new issue