]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/build/mf-to-table.py
Run grand replace for 2015.
[lilypond.git] / scripts / build / mf-to-table.py
index 8ffcde983bb569a8a0bbd552b8e2da3b4e7589ab..03284dc8b155da04c6dcd7f717e0c5a9836a8b57 100644 (file)
@@ -4,7 +4,7 @@
 
 # This file is part of LilyPond, the GNU music typesetter.
 #
-# Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+# Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 #
 # LilyPond is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@ import time
 
 def read_log_file (fn):
     str = open (fn).read ()
-    str = re.sub ('\n', '', str)
+    str = re.sub ('[\n\r]', '', str)
     str = re.sub ('[\t ]+', ' ', str)
 
     deps = []
@@ -61,14 +61,20 @@ def parse_logfile (fn):
         }
     group = ''
 
-    for l in autolines:
+    for i, l in enumerate(autolines):
         tags = l.split ('@:')
         if tags[0] == 'group':
             group = tags[1]
         elif tags[0] == 'puorg':
             group = ''
         elif tags[0] == 'char':
-            name = tags[9]
+            try:
+                name = tags[9]
+            except IndexError:
+                print 'Error in mf-to-table while processing file', fn
+                print 'Index 9 >', len(tags)-1, 'on line', i
+                print l
+                raise
 
             if group:
                 name = group + '.' + name
@@ -258,6 +264,6 @@ for filenm in files:
     open (global_lisp_nm, 'w').write (global_lisp_table (g))
     if depfile_nm:
         open (depfile_nm, 'wb').write (get_deps (deps,
-                                                 [base + '.log', base + '.dvi', base + '.pfa',
+                                                 [base + '.log', base + '.dvi',
                                                   depfile_nm,
                                                   base + '.pfb']))