commit 9401e974b27f1de39b0b9637f659c29c7dbdb971
Author: Simon Howard <fraggle@soulsphere.org>
AuthorDate: Mon Jan 30 23:00:41 2017 -0500
Commit: Simon Howard <fraggle@soulsphere.org>
CommitDate: Mon Jan 30 23:00:41 2017 -0500
docgen: Fix script.
Apparently caused by previous botched merge commit.
---
man/docgen | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/man/docgen b/man/docgen
index 0223370d..e477e74e 100755
--- a/man/docgen
+++ b/man/docgen
@@ -317,8 +317,10 @@ def read_wikipages():
line = re.sub('\#.*$', '', line)
- if not re.match('^\s*$', line):
+ if not re.match(r'^\s*$', line):
wikipages.append(line)
+ finally:
+ f.close()
# Add wiki page links
@@ -363,7 +365,7 @@ def process_file(filename):
current_config_file = None
- f = io.open(file, encoding='UTF-8')
+ f = io.open(filename, encoding='UTF-8')
try:
param = None
@@ -412,6 +414,8 @@ def process_file(filename):
# Start of a normal comment
param = Parameter()
waiting_for_checkparm = False
+ finally:
+ f.close()
def process_files(path):
# Process all C source files.
@@ -440,9 +444,11 @@ def print_template(template_file, content):
else:
line = line.replace("@content", content)
stdout(line.rstrip().encode('UTF-8') + b'\n')
+ finally:
+ f.close()
+
+def manpage_output(targets, template_file):
-def manpage_output(targets, template_file):
-
content = ""
for t in targets: