diff --git a/changelog.md b/changelog.md index 628fb96..696be85 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,10 @@ +# Version 1.2.2 + +- Added 'Update events in snirf file (BLAZES)...' and renamed 'Update events in snirf file...' to 'Update events in snirf file (BORIS)...' +- The BLAZES option will assign events that are exported directly from the software [BLAZES](https://git.research.dezeeuw.ca/tyler/blazes) +- Moved the updating logic to a seperate file for better reusability and generalization + + # Version 1.2.1 - Added a requirements.txt file to ensure compatibility diff --git a/flares_updater.py b/flares_updater.py index 13d2973..3897f73 100644 --- a/flares_updater.py +++ b/flares_updater.py @@ -18,11 +18,12 @@ import subprocess from datetime import datetime PLATFORM_NAME = platform.system().lower() +APP_NAME = "flares" if PLATFORM_NAME == 'darwin': - LOG_FILE = os.path.join(os.path.dirname(sys.executable), "../../../flares_updater.log") + LOG_FILE = os.path.join(os.path.dirname(sys.executable), f"../../../{APP_NAME}_updater.log") else: - LOG_FILE = os.path.join(os.getcwd(), "flares_updater.log") + LOG_FILE = os.path.join(os.getcwd(), f"{APP_NAME}_updater.log") def log(msg): @@ -147,7 +148,7 @@ def copy_update_files_darwin(src_folder, dest_folder, updater_name): def remove_quarantine(app_path): script = f''' - do shell script "xattr -d -r com.apple.quarantine {shlex.quote(app_path)}" with administrator privileges with prompt "FLARES needs privileges to finish the update. (1/2)" + do shell script "xattr -d -r com.apple.quarantine {shlex.quote(app_path)}" with administrator privileges with prompt "{APP_NAME} needs privileges to finish the update. (1/2)" ''' try: subprocess.run(['osascript', '-e', script], check=True) @@ -162,7 +163,7 @@ def main(): log(f"[Updater] sys.argv: {sys.argv}") if len(sys.argv) != 3: - log("Invalid arguments. Usage: flares_updater ") + log(f"Invalid arguments. Usage: {APP_NAME}_updater ") sys.exit(1) update_folder = sys.argv[1] @@ -215,7 +216,7 @@ def main(): if PLATFORM_NAME == 'darwin': log(f'Attempting to delete {ppparent_dir}') delete_path(ppparent_dir) - update_folder = os.path.join(sys.argv[1], "flares-darwin") + update_folder = os.path.join(sys.argv[1], f"{APP_NAME}-darwin") copy_update_files_darwin(update_folder, pppparent_dir, updater_name) else: