From b190c4bd170542bff87c52a00b4600908e0927bf Mon Sep 17 00:00:00 2001 From: Mc-muffin <8714476+Mc-muffin@users.noreply.github.com> Date: Sat, 30 Nov 2024 09:33:23 -0500 Subject: [PATCH] Add --single-build flag for Julian --- Tales_Exe.py | 8 ++++++++ pythonlib/games/ToolsTOR.py | 13 +++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Tales_Exe.py b/Tales_Exe.py index 7c9f056..07deead 100644 --- a/Tales_Exe.py +++ b/Tales_Exe.py @@ -128,6 +128,13 @@ def get_arguments(argv=None): action="store_true", help="(Optional) - Insert only changed files not yet commited", ) + + sp_insert.add_argument( + "--single-build", + required=False, + action="store_true", + help="(Optional) - Create just a single iso instead", + ) args = parser.parse_args() @@ -148,6 +155,7 @@ def getTalesInstance(args, game_name): talesInstance = ToolsTOR.ToolsTOR( args.project.resolve(), insert_mask, args.only_changed ) + talesInstance.single_build = args.single_build elif game_name == "NDX": talesInstance = ToolsNDX.ToolsNDX("TBL_All.json") else: diff --git a/pythonlib/games/ToolsTOR.py b/pythonlib/games/ToolsTOR.py index 06db7cb..657e4c3 100644 --- a/pythonlib/games/ToolsTOR.py +++ b/pythonlib/games/ToolsTOR.py @@ -81,6 +81,16 @@ class ToolsTOR(ToolsTales): self.list_status_insertion.extend(insert_mask) self.changed_only = changed_only self.repo_path = str(base_path) + self.build_ts: datetime.datetime = datetime.datetime.now() + self.single_build: bool = False + + + def get_build_name(self) -> str: + if self.single_build: + return "TalesOfRebirth_latest" + else: + n: datetime.datetime = self.build_ts + return f"TalesOfRebirth_{n.year:02d}{n.month:02d}{n.day:02d}{n.hour:02d}{n.minute:02d}" # Extract the story files @@ -1348,9 +1358,8 @@ class ToolsTOR(ToolsTales): self.clean_builds(self.paths["game_builds"]) # Set up new iso name - n: datetime.datetime = datetime.datetime.now() new_iso = self.paths["game_builds"] - new_iso /= f"TalesOfRebirth_{n.year:02d}{n.month:02d}{n.day:02d}{n.hour:02d}{n.minute:02d}.iso" + new_iso /= self.get_build_name() + ".iso" with FileIO(new_iso, "wb+") as new: