def ckan_extension_template(name, target):
setupdir = '<STR_LIT>'.format(target, name)<EOL>extdir = setupdir + '<STR_LIT>'.format(name)<EOL>templatedir = extdir + '<STR_LIT>'<EOL>staticdir = extdir + '<STR_LIT>'<EOL>makedirs(templatedir + '<STR_LIT>')<EOL>makedirs(staticdir)<EOL>here = dirname(__file__)<EOL>copyfile(here + '<STR_LIT>', staticdir + '<STR_LIT>')<EOL>copyfile(here + '<STR_LIT>',<EOL>staticdir + '<STR_LIT>')<EOL>filecontents = [<EOL>(setupdir + '<STR_LIT>', SETUP_PY),<EOL>(setupdir + '<STR_LIT>', DOT_GITIGNORE),<EOL>(setupdir + '<STR_LIT>', NAMESPACE_PACKAGE),<EOL>(extdir + '<STR_LIT>', '<STR_LIT>'),<EOL>(extdir + '<STR_LIT>', PLUGINS_PY),<EOL>(templatedir + '<STR_LIT>', PROMOTED_SNIPPET),<EOL>(templatedir + '<STR_LIT>', FOOTER_HTML),<EOL>]<EOL>for filename, content in filecontents:<EOL><INDENT>with open(filename, '<STR_LIT:w>') as f:<EOL><INDENT>f.write(content.replace('<STR_LIT>', name))<EOL><DEDENT><DEDENT>
Create ckanext-(name) in target directory.