def create_gallery_generator(command_line_arguments, css_directory): """ Given command line arguments, wire up the application and return it to the main function. This requires creating most of the objects described in the other files from this directory. Args: command_line_arguments the command line arguments with the program name removed. css_directory the directory containing the CSS files. """ input_data = parse_command_line_arguments(command_line_arguments) # First parse the manifest file with open(input_data['manifest_file'], 'r') as manifest_file: parser = ManifestParser(manifest_file) lookup_table = parser.get_json_data() factory = GalleryItemFactory(lookup_table, input_data['should_prompt']) template_exporter = exporter.create_photo_directory_exporter() template_writer = \ templatewriter.create_template_writer(input_data['output_directory']) return GalleryGenerator(gallery_item_factory=factory, input_directory=input_data['input_directory'], output_directory=input_data['output_directory'], static_files_directory=css_directory, exporter=template_exporter, template_writer=template_writer)
def get_exporter(self): """ Returns a directory exporter. """ return exporter.create_photo_directory_exporter()