import re
import os
import copy
+import shutil
# TODO: We are using os.popen3, which has been deprecated since python 2.6. The
# suggested replacement is the Popen function of the subprocess module.
# Unfortunately, on windows this needs the msvcrt module, which doesn't seem
dst_path = os.path.split(dst)[0]
if not os.path.isdir (dst_path):
os.makedirs (dst_path)
- os.link (src, dst)
+ try:
+ os.link (src, dst)
+ except AttributeError:
+ shutil.copyfile (src, dst)
+ except OSError:
+ print '\nCould not overwrite file', dst
+ raise CompileError(self.basename())
def additional_files_to_consider (self, base, full):
return []
#(define output-empty-score-list #f)
#(ly:add-file-name-alist '(%s
))\n
-""" % '\n'.join(['("%s.ly" . "%s")\n' % (ly.basename (), name)
+""" % '\n'.join(['("%s.ly" . "%s")\n' % (ly.basename ().replace('\\','/'), name)
for ly in lys]))
def split_output_files(directory):