From 1b41d3ac6fe4e0e969d294b95f19c3f111eb06af Mon Sep 17 00:00:00 2001 From: Richard Mahn Date: Tue, 17 Jan 2017 12:48:10 -0700 Subject: [PATCH] Removed all.html from being created --- functions/convert/transform_obs.py | 5 ----- tests/test_transformOBS.py | 5 +---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/functions/convert/transform_obs.py b/functions/convert/transform_obs.py index 6c6be9c..b50e63e 100644 --- a/functions/convert/transform_obs.py +++ b/functions/convert/transform_obs.py @@ -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) @@ -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.') diff --git a/tests/test_transformOBS.py b/tests/test_transformOBS.py index b53300a..7f17be0 100644 --- a/tests/test_transformOBS.py +++ b/tests/test_transformOBS.py @@ -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') @@ -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()