Source code for pyscaffold.templates
# -*- coding: utf-8 -*-
import os.path
import string
from pkgutil import get_data
__author__ = "Florian Wilhelm"
__copyright__ = "Blue Yonder"
__license__ = "new BSD"
[docs]def get_template(name):
pkg_name = __name__.split(".", 1)[0]
file_name = "{name}.template".format(name=name)
data = get_data(pkg_name, os.path.join("data", file_name))
return string.Template(data.decode())
[docs]def setup(args):
template = get_template("setup")
return template.substitute(vars(args))
[docs]def gitignore(args):
template = get_template("gitignore")
return template.substitute(vars(args))
[docs]def gitignore_empty(args):
template = get_template("gitignore_empty")
return template.substitute(vars(args))
[docs]def sphinx_conf(args):
template = get_template("sphinx_conf")
return template.substitute(vars(args))
[docs]def sphinx_index(args):
template = get_template("sphinx_index")
return template.substitute(vars(args))
[docs]def versioneer(args):
template = get_template("versioneer")
return template.safe_substitute(vars(args))
[docs]def version(args):
template = get_template("_version")
return template.safe_substitute(vars(args))
[docs]def manifest_in(args):
template = get_template("manifest_in")
return template.substitute(vars(args))
[docs]def sphinx_makefile(args):
template = get_template("sphinx_makefile")
return template.safe_substitute(vars(args))
[docs]def readme(args):
template = get_template("readme")
return template.substitute(vars(args))
[docs]def authors(args):
template = get_template("authors")
return template.substitute(vars(args))
[docs]def requirements(args):
template = get_template("requirements")
return template.substitute(vars(args))
[docs]def copying(args):
template = get_template("copying")
return template.substitute(vars(args))
[docs]def init(args):
template = get_template("__init__")
return template.substitute(vars(args))
[docs]def coveragerc(args):
template = get_template("coveragerc")
return template.substitute(vars(args))