Skip to content

Commit

Permalink
Merge pull request #9 from richmahn/feature/remove-all-html
Browse files Browse the repository at this point in the history
Remove all.html from being generated for OBS repos
  • Loading branch information
Phil Hopper committed Jan 18, 2017
2 parents fd70b1b + 1b41d3a commit 2faa9c0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
5 changes: 0 additions & 5 deletions functions/convert/transform_obs.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,12 @@ def run(self):
with open(os.path.join(current_dir, 'obs-template.html')) as template_file:
html_template = string.Template(template_file.read())

complete_html = ''
for filename in files:
if filename.endswith('.md'):
# read the markdown file
with codecs.open(filename, 'r', 'utf-8-sig') as md_file:
md = md_file.read()
html = markdown.markdown(md)
complete_html += html
html = html_template.safe_substitute(content=html)
html_filename = os.path.splitext(os.path.basename(filename))[0] + ".html"
output_file = os.path.join(self.output_dir, html_filename)
Expand Down Expand Up @@ -116,8 +114,5 @@ def run(self):
for error in inspector.errors:
self.error_message(error)

complete_html = html_template.safe_substitute(content=complete_html)
write_file(os.path.join(self.output_dir, 'all.html'), complete_html)

self.log_message('Made one HTML of all stories in all.html.')
self.log_message('Finished processing Markdown files.')
5 changes: 1 addition & 4 deletions tests/test_transformOBS.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_run(self):
tx.run()

# verify the output
# 07 JAN 2017, NB: currently just one html file is being output, all.html
# 07 JAN 2017, NB: currently no html files are being generated
# files_to_verify = []
# for i in range(1, 51):
# files_to_verify.append(str(i).zfill(2) + '.html')
Expand All @@ -75,8 +75,5 @@ def test_run(self):
# file_name = os.path.join(self.out_dir, file_to_verify)
# self.assertTrue(os.path.isfile(file_name), 'OBS HTML file not found: {0}'.format(file_name))

file_name = os.path.join(self.out_dir, 'all.html')
self.assertTrue(os.path.isfile(file_name), 'OBS HTML file not found: {0}'.format(file_name))

if __name__ == '__main__':
unittest.main()

0 comments on commit 2faa9c0

Please sign in to comment.