From 9fbccc32496b569fdf63d41deaf8d2d3ba523c60 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 15 Jul 2004 07:19:00 +0000 Subject: [PATCH] release commit --- VERSION | 2 +- cygwin/lily-wins.py | 69 +++++++++++++++---- input/mutopia/W.A.Mozart/mozart-hrn3-rondo.ly | 2 +- 3 files changed, 56 insertions(+), 17 deletions(-) diff --git a/VERSION b/VERSION index 1ab1bd0c93..b60f22cbd5 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=2 -PATCH_LEVEL=4 +PATCH_LEVEL=5 MY_PATCH_LEVEL= diff --git a/cygwin/lily-wins.py b/cygwin/lily-wins.py index 299cfe46f8..06d22595e5 100644 --- a/cygwin/lily-wins.py +++ b/cygwin/lily-wins.py @@ -1,16 +1,21 @@ #!@PYTHON@ # lily-wins.py -- LilyPond command for .ly on Windows +import getopt import os import re import sys +import time + +do_debug = 0 def usage (): print 'Usage [-h,--help] lily-wins LY-FILE' # print debugging stuff for now def debug (s): - print s + if do_debug: + print s def read_pipe (command): debug ('command:' + command) @@ -33,16 +38,36 @@ def escape_shell (x): return re.sub ("(\s|[`'\"\\\\])", r'\\\1',x) # return re.sub (r'''([^\\])([`'"\\\s])''', r'\1\\\2', x) # help emacs'" broken python mode + +def usage (): + print '''lily-wins [options] file + +Options supported: + + -h, --help this help screen + -d, --debug print debugging information + +''' debug (`sys.argv`) -if len (sys.argv) != 2 \ - or sys.argv[1] == '-h' or sys.argv[1] == '--help': +######## +# main +(opts, files)=getopt.getopt (sys.argv[1:],'dh', ['help', 'debug']) + +for (o,a) in opts: + if o == '-d' or o == '--debug': + do_debug = 1 + elif o == '-h' or o == '--help': + usage () + sys.exit (0) + +if files == []: usage () - sys.exit (0) - -native_file = sys.argv[1] + sys.exit (1) +native_file = files[0] +print 'Processing %s ...' % native_file file = read_pipe ('/usr/bin/cygpath -au %s' % escape_shell (native_file)) if not file: file = native_file @@ -54,7 +79,7 @@ if not dir: dir = '.' base = os.path.basename (file) stem = strip_extension (base, '.ly') -print `vars ()` +debug ( `vars ()`) native_base = '%(dir)s/%(stem)s' % vars () native_base = read_pipe ('/usr/bin/cygpath -aw %s' % escape_shell (native_base)) @@ -78,14 +103,28 @@ if not pdfview: pdfview = 'xpdf' os.chdir (dir) +pdffile = '%(stem)s.pdf' % vars () +if os.path.exists (pdffile): + os.unlink (pdffile) + + +script = '/usr/bin/lilypond' + if os.path.exists ('/usr/bin/ly2dvi'): - system ('/usr/bin/ly2dvi -p %s > %s.log 2>&1' % (escape_shell (base), - escape_shell (stem))) -else: - system ('/usr/bin/lilypond %s > %s.log 2>&1' % (escape_shell (base), - escape_shell (stem))) -if not os.path.exists ('%(stem)s.pdf' % vars ()): + script = '/usr/bin/ly2dvi' + +stat = system ('%s -p %s > %s.log 2>&1' % (script, escape_shell (base), + escape_shell (stem))) + +if not os.path.exists (pdffile): # message box? - sys.stderr.write ('pdf output not found\n') + sys.stderr.write ('PDF output not found. Error log: \n') -system ('%s %s.pdf' % (escape_shell (pdfview), escape_shell (native_base))) + map (sys.stderr.write, open (stem + '.log').readlines ()[-20:]) + sys.stderr.write ('A full log is in the file %s.log\n' % stem) + sys.stderr.write ('\n\nPress enter to close window\n') + sys.stdin.readline () +else: + + # run even if failed, to make sure that error + system ('%s %s.pdf' % (escape_shell (pdfview), escape_shell (native_base))) diff --git a/input/mutopia/W.A.Mozart/mozart-hrn3-rondo.ly b/input/mutopia/W.A.Mozart/mozart-hrn3-rondo.ly index e0b80bea96..0187d83154 100644 --- a/input/mutopia/W.A.Mozart/mozart-hrn3-rondo.ly +++ b/input/mutopia/W.A.Mozart/mozart-hrn3-rondo.ly @@ -165,7 +165,7 @@ rondo = \notes \relative c' \cresc g'2. bes,2. a4. b16[ c d e f g] a4. f4 d8 - [\endcresc c8\f g' e] c[ g e] + \endcresc c8[\f g' e] c[ g e] c[ e' c] g[ e c] g4 r8 g''8[ e c] -- 2.39.5