# This file is part of LilyPond, the GNU music typesetter.
#
-# Copyright (C) 1998--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+# Copyright (C) 1998--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
# Jan Nieuwenhuizen <janneke@gnu.org>
#
# LilyPond is free software: you can redistribute it and/or modify
lilypond_version_re_str = '\\\\version *\"([0-9.]+)"'
lilypond_version_re = re.compile (lilypond_version_re_str)
+lilypond_version_strict_re_str = '\\\\version *\"([0-9]+[.][0-9]+[.][0-9]+)"'
+lilypond_version_strict_re = re.compile (lilypond_version_strict_re_str)
help_summary = (
_ ('''Update LilyPond input to newer version. By default, update from the
%s
%s
-''' % ( _ ('Copyright (c) %s by') % '2001--2011',
+''' % ( _ ('Copyright (c) %s by') % '2001--2012',
' '.join (authors),
_ ('Distributed under terms of the GNU General Public License.'),
_ ('It comes with NO WARRANTY.')))
string."""
conv_list = get_conversions (from_version, to_version)
- ly.progress (_ ("Applying conversion: "))
+ ly.progress (_ ("Applying conversion: "), newline = False)
last_conversion = ()
try:
if not conv_list:
last_conversion = to_version
for x in conv_list:
- ly.progress (tup_to_str (x[0]))
if x != conv_list[-1]:
- ly.progress (', ')
+ ly.progress (tup_to_str (x[0]), newline = False)
+ ly.progress (', ', newline = False)
+ else:
+ ly.progress (tup_to_str (x[0]))
str = x[1] (str)
last_conversion = x[0]
def guess_lilypond_version (input):
- m = lilypond_version_re.search (input)
+ m = lilypond_version_strict_re.search (input)
if m:
return m.group (1)
+ m = lilypond_version_re.search (input)
+ if m:
+ raise InvalidVersion (m.group (1))
else:
return ''
"Valid version strings consist of three numbers, "
"separated by dots, e.g. `2.8.12'") % (f, v.version) )
- ly.progress ('\n')
main ()