X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fbuild%2Fextract_texi_filenames.py;h=61f6014e160894808a8c1cde678b0e24b861abfa;hb=c9803f36f9ca585c15024e16b1cbef0bce0b31b3;hp=36adb50ea215946209e7734f2fe8f080115d105a;hpb=794dcbdb52faf4292036cd1b0270a956cf4316a3;p=lilypond.git diff --git a/scripts/build/extract_texi_filenames.py b/scripts/build/extract_texi_filenames.py index 36adb50ea2..61f6014e16 100644 --- a/scripts/build/extract_texi_filenames.py +++ b/scripts/build/extract_texi_filenames.py @@ -49,7 +49,7 @@ def help (text): outdir = '.' split = "custom" -include_path = [] +include_path = ['.',] master_map_file = '' initial_map = {} for opt in options_list: @@ -60,6 +60,8 @@ for opt in options_list: if o == '-I' or o == '--include': if os.path.isdir (a): include_path.append (a) + else: + print 'NOT A DIR from: ', os.getcwd (), a elif o == '-o' or o == '--output': outdir = a elif o == '-s' or o == '--split': @@ -85,15 +87,17 @@ section_translation_re = re.compile ('^@(node|(?:unnumbered|appendix)\ external_node_re = re.compile (r'\s+@c\s+external.*') def expand_includes (m, filename): - filepath = os.path.join (os.path.dirname (filename), m.group(1)) + include_name = m.group (1) + filepath = os.path.join (os.path.dirname (filename), include_name) if os.path.exists (filepath): return extract_sections (filepath)[1] else: for directory in include_path: - filepath = os.path.join (directory, m.group(1)) + filepath = os.path.join (directory, include_name) if os.path.exists (filepath): return extract_sections (filepath)[1] - print "Unable to locate include file " + filepath + print 'No such file: ' + include_name + print 'Search path: ' + ':'.join (include_path) return '' lang_re = re.compile (r'^@documentlanguage (.+)', re.M) @@ -181,6 +185,7 @@ def process_sections (filename, lang_suffix, page): sections = section_translation_re.findall (page) basename = os.path.splitext (os.path.basename (filename))[0] p = os.path.join (outdir, basename) + lang_suffix + '.xref-map' + print 'writing:', p f = open (p, 'w') this_title = ''