Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(850)

Unified Diff: scripts/build/extract_texi_filenames.py

Issue 4515042: Making website build almost completely quiet (Closed)
Patch Set: Add a -q quiet flag to 'make website' scripts Created 12 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/build/bib2texi.py ('k') | scripts/build/mass-link.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/build/extract_texi_filenames.py
diff --git a/scripts/build/extract_texi_filenames.py b/scripts/build/extract_texi_filenames.py
index fcb464d53d07b4ef7a99cfaccce2a0d1d1ea7cab..33a31b7af5caad05e0836d387e0313fd0d17e99a 100644
--- a/scripts/build/extract_texi_filenames.py
+++ b/scripts/build/extract_texi_filenames.py
@@ -34,11 +34,12 @@ import re
import os
import getopt
-options_list, files = getopt.getopt (sys.argv[1:],'o:s:hI:m:',
+options_list, files = getopt.getopt (sys.argv[1:],'o:s:hI:m:k:q',
['output=', 'split=',
'help', 'include=',
'master-map-file=',
- 'known-missing-files='])
+ 'known-missing-files=',
+ 'quiet'])
help_text = r"""Usage: %(program_name)s [OPTIONS]... TEXIFILE...
Extract files names for texinfo (sub)sections from the texinfo files.
@@ -50,8 +51,9 @@ Options:
-o, --output=DIRECTORY write .xref-map files to DIRECTORY
-s, --split=MODE split manual according to MODE. Possible values
are section and custom (default)
- --known-missing-files a filename which has a list of files known
+ -k, --known-missing-files a filename which has a list of files known
to be missing for this make
+ -q, --quiet suppress most messages
"""
def help (text):
@@ -64,6 +66,7 @@ include_path = ['.',]
master_map_file = ''
known_missing_files = []
known_missing_files_file = ''
+suppress_output = False
initial_map = {}
for opt in options_list:
o = opt[0]
@@ -87,6 +90,8 @@ for opt in options_list:
known_missing_files_file = a
else:
print 'Missing files list file not found: ', a
+ elif o == '-q' or o == '--quiet':
+ suppress_output = True
else:
raise Exception ('unknown option: ' + o)
@@ -210,7 +215,8 @@ 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
+ if not suppress_output:
+ print 'writing:', p
f = open (p, 'w')
this_title = ''
@@ -287,6 +293,7 @@ if master_map_file:
initial_map[m.group (1)] = (m.group (1), m.group (2), m.group (3))
for filename in files:
- print "extract_texi_filenames.py: Processing %s" % filename
+ if not suppress_output:
+ print "extract_texi_filenames.py: Processing %s" % filename
(lang_suffix, sections) = extract_sections (filename)
process_sections (filename, lang_suffix, sections)
« no previous file with comments | « scripts/build/bib2texi.py ('k') | scripts/build/mass-link.py » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b