Fixup autoindex.rst only if it exists

Closes-Bug: #1370370

Change-Id: I05638808b577db8e96e5b83aa8b5a9c47f8170c1
This commit is contained in:
Davanum Srinivas 2014-09-21 18:13:37 -04:00 committed by Davanum Srinivas (dims)
parent 42eab0c82f
commit 73d116001b

View File

@ -39,13 +39,15 @@ exclude_patterns = [
]
# Prune the excluded patterns from the autoindex
for line in fileinput.input('api/autoindex.rst', inplace=True):
found = False
for pattern in exclude_patterns:
if fnmatch.fnmatch(line, '*' + pattern[4:]):
found = True
if not found:
print line,
PATH = 'api/autoindex.rst'
if os.path.isfile(PATH) and os.access(PATH, os.R_OK):
for line in fileinput.input(PATH, inplace=True):
found = False
for pattern in exclude_patterns:
if fnmatch.fnmatch(line, '*' + pattern[4:]):
found = True
if not found:
print line,
# The suffix of source filenames.
source_suffix = '.rst'
@ -89,4 +91,4 @@ latex_documents = [
]
# Example configuration for intersphinx: refer to the Python standard library.
#intersphinx_mapping = {'http://docs.python.org/': None}
#intersphinx_mapping = {'http://docs.python.org/': None}