# 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.')))
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 ''