]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/lilypond-book.py
Eliminate unix-specific -u flags from internationalization build
[lilypond.git] / scripts / lilypond-book.py
index 2564aea75ffb98e0b50fc5ceb60c7c5325e6f50e..e1d1824d75b013f51d6c0736c579ed469c7d4722 100644 (file)
@@ -29,7 +29,6 @@ TODO:
 '''
 
 import glob
-import md5
 import os
 import re
 import stat
@@ -108,12 +107,12 @@ def warranty ():
     ly.encoded_write (sys.stdout, '''
 %s
 
-%s
+  %s
 
 %s
 %s
-''' % ( _ ('Copyright (c) %s by') % '2001--2008',
-        ' '.join (authors),
+''' % ( _ ('Copyright (c) %s by') % '2001--2009',
+        '\n  '.join (authors),
         _ ("Distributed under terms of the GNU General Public License."),
         _ ("It comes with NO WARRANTY.")))
 
@@ -719,27 +718,27 @@ output = {
         OUTPUT: r'''{%%
 \parindent 0pt
 \ifx\preLilyPondExample \undefined
- \relax
 \else
- \preLilyPondExample
 \expandafter\preLilyPondExample
 \fi
 \def\lilypondbook{}%%
 \input %(base)s-systems.tex
 \ifx\postLilyPondExample \undefined
- \relax
 \else
- \postLilyPondExample
 \expandafter\postLilyPondExample
 \fi
 }''',
 
         PRINTFILENAME: '''\\texttt{%(filename)s}
 ''',
 
-        QUOTE: r'''\begin{quotation}%(str)s
+        QUOTE: r'''\begin{quotation}
+%(str)s
 \end{quotation}''',
 
         VERBATIM: r'''\noindent
-\begin{verbatim}%(verb)s\end{verbatim}''',
+\begin{verbatim}%(verb)s\end{verbatim}
+''',
 
         VERSION: program_version,
 
@@ -1234,7 +1233,13 @@ class LilypondSnippet (Snippet):
 
     def get_checksum (self):
         if not self.checksum:
-            hash = md5.md5 (self.relevant_contents (self.full_ly ()))
+            # Work-around for md5 module deprecation warning in python 2.5+:
+            try: 
+                from hashlib import md5
+            except ImportError:
+                from md5 import md5
+
+            hash = md5 (self.relevant_contents (self.full_ly ()))
 
             ## let's not create too long names.
             self.checksum = hash.hexdigest ()[:10]
@@ -1475,9 +1480,9 @@ class LilypondSnippet (Snippet):
             doctitle = base + '.doctitle'
             translated_doctitle = doctitle + document_language
             if os.path.exists (translated_doctitle):
-                str += '@lydoctitle %s\n' % open (translated_doctitle).read ()
+                str += '@lydoctitle %s\n\n' % open (translated_doctitle).read ()
             elif os.path.exists (doctitle):
-                str += '@lydoctitle %s\n' % open (doctitle).read ()
+                str += '@lydoctitle %s\n\n' % open (doctitle).read ()
         if TEXIDOC in self.option_dict:
             texidoc = base + '.texidoc'
             translated_texidoc = texidoc + document_language