本文整理汇总了Python中manifestparser.ManifestParser.get_json_data方法的典型用法代码示例。如果您正苦于以下问题:Python ManifestParser.get_json_data方法的具体用法?Python ManifestParser.get_json_data怎么用?Python ManifestParser.get_json_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类manifestparser.ManifestParser
的用法示例。
在下文中一共展示了ManifestParser.get_json_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_gallery_generator
# 需要导入模块: from manifestparser import ManifestParser [as 别名]
# 或者: from manifestparser.ManifestParser import get_json_data [as 别名]
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)