]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix Texinfo skeleton maker
authorJohn Mandereau <john.mandereau@gmail.com>
Sat, 9 Aug 2008 22:03:18 +0000 (00:03 +0200)
committerJohn Mandereau <john.mandereau@gmail.com>
Mon, 11 Aug 2008 16:11:58 +0000 (18:11 +0200)
buildscripts/texi-langutils.py

index cece2be39b62357c40cc2b2495658475e1e76487..d949662206dc1a888674572edf70c8f5e177392c 100644 (file)
@@ -57,7 +57,7 @@ for x in optlist:
     elif x[0] == '-l': # -l ISOLANG  set documentlanguage to ISOLANG
         doclang = '; documentlanguage: ' + x[1]
 
-texinfo_with_menus_re = re.compile (r"^(\*) +([^:\n]+)::.*?$|^@(include|menu|end menu|node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading) *(.+?)$|@(rglos){(.+?)}", re.M)
+texinfo_with_menus_re = re.compile (r"^(\*) +([^:\n]+)::.*?$|^@(include|menu|end menu|node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading) *(.*?)$|@(rglos){(.+?)}", re.M)
 
 texinfo_re = re.compile (r"^@(include|node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading) *(.+?)$|@(rglos){(.+?)}", re.M)
 
@@ -104,19 +104,23 @@ def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, topfile, outpu
                     g.write ('* ' + item[1] + '::\n')
                 elif output_file and item[4] == 'rglos':
                     output_file.write ('_(r"' + item[5] + '") # @rglos in ' + printedfilename + '\n')
+                elif item[2] == 'menu':
+                    g.write ('@menu\n')
+                elif item[2] == 'end menu':
+                    g.write ('@end menu\n\n')
                 else:
                     g.write ('@' + item[2] + ' ' + item[3] + '\n')
                     if node_trigger:
                         g.write (n_blurb)
                         node_trigger = False
-                    if not item[2] in ('include', 'menu', 'end menu'):
+                    elif item[2] == 'include':
+                        includes.append (item[3])
+                    else:
                         if output_file:
                             output_file.write ('# @' + item[2] + ' in ' + \
                                 printedfilename + '\n_(r"' + item[3].strip () + '")\n')
                         if item[2] == 'node':
                             node_trigger = True
-                    elif item[2] == 'include':
-                        includes.append (item[3])
             g.write (end_blurb)
             g.close ()