Import Apache Automate scripts into ToolsTales_Executable and call it for SLPS

This commit is contained in:
Stewie
2022-04-10 17:31:02 -04:00
parent 200baa8d40
commit 41195b43c4
3 changed files with 35 additions and 26 deletions

View File

@@ -4,6 +4,9 @@ from pywinauto import mouse
from pywinauto.findwindows import find_windows
import os
import shutil
import subprocess
def open_apache3_iso(repo_name):
@@ -52,7 +55,7 @@ def browse_replace_file(file_replace_ele, new_file_path, repo_name):
file_replace_ele.child_window(title="Replace File", auto_id="1094", control_type="Button").wrapper_object().click()
def replace_files(files_list, app):
def replace_files(files_list, repo_name, app):
new_file_path_format = os.path.join( os.path.normpath(os.getcwd() + os.sep + os.pardir), "Data",repo_name, "Disc", "New")
for file_name in files_list:
@@ -73,31 +76,27 @@ def replace_files(files_list, app):
browse_replace_file(file_replace_ele, os.path.join(new_file_path_format, file_name), repo_name)
#Files to reinsert
#files_list = ['SLPS_254.50', 'DAT.bin']
files_list = ['SLPS_254.50']
repo_name = "Tales-Of-Rebirth"
#copy original Iso
original_path = os.path.join(os.getcwd(), "..", "Data", repo_name, "Disc", "Original", "{}.iso".format(repo_name))
new_path = os.path.join(os.getcwd(), "..", "Data", repo_name, "Disc", "New", "{}.iso".format(repo_name))
print("Copy Original Iso into New folder")
shutil.copy( original_path, new_path)
try:
app = application.Application(backend="uia").connect(title='Apache3 Build 3.10.6 (BETA)')
app.Apache3Build.close()
def apache_job(files_list, repo_name):
except:
print("Open Apache3 and load the iso")
app = open_apache3_iso(repo_name)
print("Replace the different files")
replace_files(files_list,app)
#copy original Iso
original_path = os.path.join(os.getcwd(), "..", "Data", repo_name, "Disc", "Original", "{}.iso".format(repo_name))
new_path = os.path.join(os.getcwd(), "..", "Data", repo_name, "Disc", "New", "{}.iso".format(repo_name))
print("Close Apache3")
app.Apache3Build.close()
print("Copy Original Iso into New folder")
shutil.copy( original_path, new_path)
try:
app = application.Application(backend="uia").connect(title='Apache3 Build 3.10.6 (BETA)')
app.Apache3Build.close()
except:
print("Open Apache3 and load the iso")
app = open_apache3_iso(repo_name)
print("Replace the different files")
replace_files(files_list, repo_name, app)
print("Close Apache3")
app.Apache3Build.close()

View File

@@ -6,9 +6,16 @@ import os
import io
import re
import requests
import subprocess
import ApacheAutomate
SCRIPT_VERSION = "0.3"
def generate_xdelta_patch(original_path, new_path, xdelta_name="Tales-Of-Rebirth_Patch_New.xdelta"):
subprocess.run(["xdelta", "-s", original_path, new_path, xdelta_name])
def get_Releases(org, repo_name, latest=False):
#git_url = "https://api.github.com/repos/SymphoniaLauren/Tales-of-Rebirth/releases"
@@ -205,6 +212,9 @@ if __name__ == "__main__":
#SLPS
tales_instance.insert_Menu_File("../Data/TOR/Disc/Original/SLPS_254.50")
ApacheAutomate.apache_job(['SLPS_254.50'], "Tales-Of-Rebirth")
print("new SLPS is found inside Data/{}/Menu/New".format(game_name))
#Other files for menu stuff

Binary file not shown.