diff --git a/functions/convert/main.py b/functions/convert/main.py index 4d73e5a..e848a4b 100644 --- a/functions/convert/main.py +++ b/functions/convert/main.py @@ -11,7 +11,7 @@ import transform_obs from glob import glob -from contextlib import closing +from shutil import copyfile from general_tools.file_utils import add_file_to_zip @@ -106,4 +106,4 @@ def handle(event, context): 'errors': errors, 'warnings': warnings, 'success': success - } \ No newline at end of file + } diff --git a/functions/convert/transform_obs.py b/functions/convert/transform_obs.py index 87af1cf..72a03bd 100644 --- a/functions/convert/transform_obs.py +++ b/functions/convert/transform_obs.py @@ -12,10 +12,12 @@ import string from glob import glob +from shutil import copyfile from general_tools.file_utils import unzip, make_dir, write_file from general_tools.url_utils import download_file from door43_tools.obs_handler import OBSInspection + class TransformOBS(object): def __init__(self, source_url, output_dir, options): @@ -92,6 +94,10 @@ def run(self): write_file(os.path.join(self.output_dir, html_filename), html) self.log_message('Converted {0} to {1}.'.format(os.path.basename(filename), os.path.basename(html_filename))) + manifest_file = os.path.join(self.files_dir, 'manifest.json') + if os.path.isfile(manifest_file): + copyfile(manifest_file, os.path.join(self.output_dir, 'manifest.json')) + # Do the OBS inspection warnings = OBSInspection(self.output_dir).run() for warning in warnings: