Added patcher
This commit is contained in:
37
patchPyAudacity.py
Normal file
37
patchPyAudacity.py
Normal file
@ -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...')
|
||||
Reference in New Issue
Block a user