+ if (self.global_options.use_source_file_names
+ and isinstance (self, LilypondFileSnippet)):
+ fout = open (dst, 'w')
+ fin = open (src, 'r')
+ for line in fin.readlines ():
+ fout.write (line.replace (self.basename (), self.final_basename ()))
+ fout.close ()
+ fin.close ()
+ else:
+ try:
+ os.link (src, dst)
+ except AttributeError:
+ shutil.copyfile (src, dst)
+ except (IOError, OSError):