summaryrefslogtreecommitdiff
path: root/tools/docs
diff options
context:
space:
mode:
authorJonathan S. Katz2019-03-31 20:20:51 +0000
committerJonathan S. Katz2019-03-31 20:20:51 +0000
commita05801ba81737ff0e7688ada1de97717d207ae51 (patch)
treecb825cfe0e7e6273296f05fddae4bee83276369e /tools/docs
parent6587592ee15f325df253a4636219f8dd31652141 (diff)
Remove global variable reference that increments the page count in the docloader.
This is primarily to remove some old code to allow for future changes to how certain types of doc files can be loaded in the future.
Diffstat (limited to 'tools/docs')
-rwxr-xr-xtools/docs/docload.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/docs/docload.py b/tools/docs/docload.py
index 91da3c88..5dd4ccdb 100755
--- a/tools/docs/docload.py
+++ b/tools/docs/docload.py
@@ -64,8 +64,6 @@ def load_doc_file(filename, f, c):
(html, errors) = tidylib.tidy_document(contents, options=tidyopts)
c.writerow([filename, ver, title, html])
- global pagecount
- pagecount += 1
# Main execution
@@ -111,6 +109,8 @@ re_tarfile = re.compile('[^/]*/doc/postgres.tar.gz$')
for member in tf:
if re_htmlfile.match(member.name):
load_doc_file(os.path.basename(member.name), tf.extractfile(member), c)
+ # after successfully preparing the file for load, increase the page count
+ pagecount += 1
if re_tarfile.match(member.name):
f = tf.extractfile(member)
inner_tar = tarfile.open(fileobj=f)
@@ -122,6 +122,8 @@ for member in tf:
if inner_member.name.endswith('.html') or inner_member.name.endswith('.htm'):
load_doc_file(inner_member.name, inner_tar.extractfile(inner_member), c)
+ # after successfully preparing the file for load, increase the page count
+ pagecount += 1
tf.close()
if not quiet: