@click.command(help="<STR_LIT>")<EOL>@utils.arg_create_mapchete_file<EOL>@utils.arg_process_file<EOL>@utils.arg_out_format<EOL>@utils.opt_out_path<EOL>@utils.opt_pyramid_type<EOL>@utils.opt_force<EOL>def create(<EOL>mapchete_file,<EOL>process_file,<EOL>out_format,<EOL>out_path=None,<EOL>pyramid_type=None,<EOL>force=False<EOL>):
if os.path.isfile(process_file) or os.path.isfile(mapchete_file):<EOL><INDENT>if not force:<EOL><INDENT>raise IOError("<STR_LIT>")<EOL><DEDENT><DEDENT>out_path = out_path if out_path else os.path.join(os.getcwd(), "<STR_LIT>")<EOL>process_template = pkg_resources.resource_filename(<EOL>"<STR_LIT>", "<STR_LIT>"<EOL>)<EOL>process_file = os.path.join(os.getcwd(), process_file)<EOL>copyfile(process_template, process_file)<EOL>mapchete_template = pkg_resources.resource_filename(<EOL>"<STR_LIT>", "<STR_LIT>"<EOL>)<EOL>output_options = dict(<EOL>format=out_format, path=out_path, **FORMAT_MANDATORY[out_format]<EOL>)<EOL>pyramid_options = {'<STR_LIT>': pyramid_type}<EOL>substitute_elements = {<EOL>'<STR_LIT>': process_file,<EOL>'<STR_LIT>': dump({'<STR_LIT>': output_options}, default_flow_style=False),<EOL>'<STR_LIT>': dump({'<STR_LIT>': pyramid_options}, default_flow_style=False)<EOL>}<EOL>with open(mapchete_template, '<STR_LIT:r>') as config_template:<EOL><INDENT>config = Template(config_template.read())<EOL>customized_config = config.substitute(substitute_elements)<EOL><DEDENT>with open(mapchete_file, '<STR_LIT:w>') as target_config:<EOL><INDENT>target_config.write(customized_config)<EOL><DEDENT>
Create an empty Mapchete and process file in a given directory.