program_version = '@TOPLEVEL_VERSION@'
program_name = os.path.basename (sys.argv[0])
+# Check if program_version contains @ characters. This will be the case if
+# the .py file is called directly while building the lilypond documentation.
+# If so, try to check for the env var LILYPOND_VERSION, which is set by our
+# makefiles and use its value.
+at_re = re.compile (r'@')
+if at_re.match (program_version):
+ if os.environ.has_key('LILYPOND_VERSION'):
+ program_version = os.environ['LILYPOND_VERSION']
+ else:
+ program_version = "unknown"
+
original_dir = os.getcwd ()
backend = 'ps'
%s
%s
-''' % ( _ ('Copyright (c) %s by') % '2001--2007',
+''' % ( _ ('Copyright (c) %s by') % '2001--2008',
' '.join (authors),
_ ("Distributed under terms of the GNU General Public License."),
_ ("It comes with NO WARRANTY.")))
'lilypondversion':
r'''(?mx)
- (?P<match>
+ [^@](?P<match>
@lilypondversion)[^a-zA-Z]''',
},