PDF Copy Bigfix 2
This commit is contained in:
@@ -10,7 +10,7 @@ from os.path import splitext, basename, join, dirname
|
|||||||
from os import makedirs
|
from os import makedirs
|
||||||
from lilypond import executable
|
from lilypond import executable
|
||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
from shutil import copy2, copy
|
from shutil import copystat, copy
|
||||||
from platform import system
|
from platform import system
|
||||||
lilypond_path=str(executable())
|
lilypond_path=str(executable())
|
||||||
if system()=="Windows" and not lilypond_path.lower().endswith('.exe'):
|
if system()=="Windows" and not lilypond_path.lower().endswith('.exe'):
|
||||||
@@ -69,9 +69,10 @@ def media_to_notes(input_path,output_path,lilypond_path=lilypond_path):
|
|||||||
|
|
||||||
#Making The PDF
|
#Making The PDF
|
||||||
run([lilypond_path,"-I",tmp,"-o",join(tmp,file_name),join(tmp,file_name+'.ly')],check=True)
|
run([lilypond_path,"-I",tmp,"-o",join(tmp,file_name),join(tmp,file_name+'.ly')],check=True)
|
||||||
|
copy(join(tmp,file_name+'.pdf'),output_path)
|
||||||
try:
|
try:
|
||||||
copy2(join(tmp,file_name+'.pdf'),output_path)
|
copystat(join(tmp,file_name+'.pdf'),output_path)
|
||||||
except:
|
except:
|
||||||
copy(join(tmp,file_name+'.pdf'),output_path)
|
pass
|
||||||
|
|
||||||
print(f"Notes PDF saved to {output_path}.")
|
print(f"Notes PDF saved to {output_path}.")
|
||||||
|
|||||||
Reference in New Issue
Block a user