]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/mup2ly.py
Changed scripts/* to use sys.argv[0]
[lilypond.git] / scripts / mup2ly.py
index 31bada9d3a93cf92c534cfbab4ac5218cf8d561a..e1ba8b8fda828d88eae24873d9c23d484e35279e 100644 (file)
@@ -47,7 +47,7 @@ else:
 sys.path.append (os.path.join (datadir, 'python'))
 sys.path.append (os.path.join (datadir, 'python/out'))
 
-program_name = 'mup2ly'
+program_name = sys.argv[0]
 program_version = '@TOPLEVEL_VERSION@'
 original_dir = os.getcwd ()
 temp_dir = os.path.join (original_dir,  '%s.dir' % program_name)
@@ -67,7 +67,7 @@ except:
 
 
 program_name = 'mup2ly'
-help_summary = _ ("Convert mup to LilyPond source")
+help_summary = _ ("Convert mup to LilyPond source.")
 
 option_definitions = [
        ('', 'd', 'debug', _ ("debug")),
@@ -127,14 +127,13 @@ def identify ():
 def warranty ():
        identify ()
        sys.stdout.write ('\n')
-       sys.stdout.write (_ ('Copyright (c) %s by' % ' 2001--2003'))
+       sys.stdout.write (_ ('Copyright (c) %s by') % '2001--2004')
        sys.stdout.write ('\n')
        sys.stdout.write ('  Han-Wen Nienhuys')
        sys.stdout.write ('  Jan Nieuwenhuizen')
-       sys.stdout.write ('\n')
-       sys.stdout.write (_ (r'''
-Distributed under terms of the GNU General Public License. It comes with
-NO WARRANTY.'''))
+       sys.stdout.write ('\n\n')
+       sys.stdout.write (_ ("Distributed under terms of the GNU General Public License."))
+       sys.stdout.write (_ ("It comes with NO WARRANTY."))
        sys.stdout.write ('\n')
 
 def progress (s):
@@ -183,9 +182,9 @@ def option_help_str (o):
        if o[1]:
                sh = '-%s' % o[1]
 
-       sep = ' '
+       sep = '  '
        if o[1] and o[2]:
-               sep = ','
+               sep = ', '
                
        long = ''
        if o[2]:
@@ -217,7 +216,7 @@ def options_help_str (opts):
        return str
 
 def help ():
-       ls = [(_ ("Usage: %s [OPTION]... FILE") % program_name),
+       ls = [(_ ("Usage: %s [OPTIONS]... FILE") % program_name),
                ('\n\n'),
                (help_summary),
                ('\n\n'),
@@ -225,7 +224,7 @@ def help ():
                ('\n'),
                (options_help_str (option_definitions)),
                ('\n\n'),
-               (_ ("Report bugs to %s") % 'bug-lilypond@gnu.org'),
+               (_ ("Report bugs to %s.") % 'bug-lilypond@gnu.org'),
                ('\n')]
        map (sys.stdout.write, ls)
        
@@ -638,8 +637,8 @@ class Staff:
                                str = str + v.dump()
                                refs = refs + '\n  \\' + v.idstring ()
                str = str + '''
-%s = \context Staff = %s <%s
->
+%s = \context Staff = %s <<%s
+>>
 
 ''' % (self.idstring (), self.idstring (), refs)
                return str
@@ -727,7 +726,7 @@ class Chord:
                str = self.note_prefix +str  + self.note_suffix
                
                if len (self.pitches) > 1:
-                       str = '<<%s>>' % str
+                       str = '<%s>' % str
                elif self.multimeasure:
                        str = 'R'
                elif len (self.pitches) == 0:
@@ -1100,8 +1099,8 @@ class Parser:
                str = str + '''
 
 \score {
-  <%s
-  >
+  <<%s
+  >>
   \paper {}
   \midi {}
 }
@@ -1291,7 +1290,7 @@ if not files:
        files = ['-']
        
 for f in files:
-
+       h = None
        if f == '-':
                h = sys.stdin
        elif f and not os.path.isfile (f):