]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/mup2ly.py
* scripts/musedata2ly.py (): idem
[lilypond.git] / scripts / mup2ly.py
index e24f38ac183730236f823ef026d3cb6c7e3808c5..2630c4931d9ab2b9b19fb0dd40f22907e161968e 100644 (file)
@@ -37,17 +37,17 @@ import tempfile
 
 # if set, LILYPONDPREFIX must take prevalence
 # if datadir is not set, we're doing a build and LILYPONDPREFIX 
-datadir = '@datadir@'
+datadir = '@local_lilypond_datadir@'
 if os.environ.has_key ('LILYPONDPREFIX') \
-   or '@datadir@' == '@' + 'datadir' + '@':
+   or '@local_lilypond_datadir@' == '@' + 'local_lilypond_datadir' + '@':
        datadir = os.environ['LILYPONDPREFIX']
 else:
-       datadir = '@datadir@'
+       datadir = '@local_lilypond_datadir@'
 
 sys.path.append (os.path.join (datadir, 'python'))
 sys.path.append (os.path.join (datadir, 'python/out'))
 
-program_name = 'ly2dvi'
+program_name = 'mup2ly'
 program_version = '@TOPLEVEL_VERSION@'
 original_dir = os.getcwd ()
 temp_dir = os.path.join (original_dir,  '%s.dir' % program_name)
@@ -55,9 +55,10 @@ errorport = sys.stderr
 keep_temp_dir_p = 0
 verbose_p = 0
 
+localedir = '@localedir@'
 try:
        import gettext
-       gettext.bindtextdomain ('lilypond', '@localedir@')
+       gettext.bindtextdomain ('lilypond', localedir)
        gettext.textdomain ('lilypond')
        _ = gettext.gettext
 except:
@@ -313,12 +314,12 @@ def mkdir_p (dir, mode=0777):
 
 # if set, LILYPONDPREFIX must take prevalence
 # if datadir is not set, we're doing a build and LILYPONDPREFIX 
-datadir = '@datadir@'
+datadir = '@local_lilypond_datadir@'
 
 if os.environ.has_key ('LILYPONDPREFIX') :
        datadir = os.environ['LILYPONDPREFIX']
 else:
-       datadir = '@datadir@'
+       datadir = '@local_lilypond_datadir@'
 
 
 while datadir[-1] == os.sep:
@@ -454,8 +455,8 @@ class Slur:
                e= self.end_chord
 
                if e and s:
-                       s.note_suffix = s.note_suffix + '('
-                       e.note_prefix = ')' + e.note_prefix
+                       s.note_suffix = s.note_suffix + '-('
+                       e.note_prefix = e.note_suffix + "-)"
                else:
                        sys.stderr.write ("\nOrphaned slur")
                        
@@ -720,19 +721,21 @@ class Chord:
                for p in self.pitches:
                        if str:
                                str = str + ' ' 
-                       str = str + pitch_to_lily_string (p) + sd
+                       str = str + pitch_to_lily_string (p)
 
-               for s in self.scripts:
-                       str = str + '-' + s
 
                str = self.note_prefix +str  + self.note_suffix
                
                if len (self.pitches) > 1:
-                       str = '<%s>' % str
+                       str = '<<%s>>' % str
                elif self.multimeasure:
-                       str = 'R' + sd
+                       str = 'R'
                elif len (self.pitches) == 0:
-                       str = 'r' + sd
+                       str = 'r'
+
+               str = str + sd
+               for s in self.scripts:
+                       str = str + '-' + s
 
                str = self.chord_prefix + str + self.chord_suffix