From e6481395b73ff245555a5e06b476879c91e7f87a Mon Sep 17 00:00:00 2001 From: Brosef Date: Tue, 16 Dec 2025 12:20:50 +0000 Subject: [PATCH] Added patcher --- patchPyAudacity.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 patchPyAudacity.py diff --git a/patchPyAudacity.py b/patchPyAudacity.py new file mode 100644 index 0000000..9799838 --- /dev/null +++ b/patchPyAudacity.py @@ -0,0 +1,37 @@ +""" +Patches the library "PyAudacity" to work with Tenacity. +""" + +import traceback + +from utils import inputYN + +print('This patches the PyAudacity library to work with Tenacity.') +print('Also I\'m pretty sure this is only required if you run Linux.') +print('DO NOT USE THIS IF YOU USE AUDACITY.') +print('If you\'d like to undo the patch, just reinstall PyAudacity through pip.') +print('') +cont = inputYN('Would you still like to continue? (y/n) > ') + +if not cont: + print('User abort.') + exit() + +try: + import pyaudacity +except ImportError as e: + print('There was an error importing pyaudacity. Do you have the library installed?') + print(traceback.format_exc()) + exit(1) + +print(f'Found PuAudacity at {pyaudacity.__file__}') + +print('Patching...') +with open(pyaudacity.__file__, 'r', encoding='utf-8') as f: + content = f.read() + +with open(pyaudacity.__file__, 'w', encoding='utf-8') as f: + f.write(content.replace('audacity_script_pipe', 'tenacity_script_pipe')) + +print('Done.') +input('Press enter to continue...')