Functions for cleaning up after Cookiecutter project generation occurs.
Move the generated project to the same level as repo_dir, then delete repo_dir.
Called when Cookiecutter receives a repo as an argument instead of a project template directory.
Parameters: |
|
---|---|
Returns: | True if successful, else False. |
All exceptions used in the Cookiecutter code base are defined here.
Bases: exceptions.Exception
Base exception class. All Cookiecutter-specific exceptions should subclass this class.
Bases: cookiecutter.exceptions.CookiecutterException
Raised during cleanup when remove_repo() can’t find a generated project directory inside of a repo.
Bases: cookiecutter.exceptions.CookiecutterException
Raised when a project’s input dir is not templated. The name of the input directory should always contain a string that is rendered to something else, so that input_dir != output_dir.
Bases: cookiecutter.exceptions.CookiecutterException
Raised when Cookiecutter cannot determine which directory is the project template, e.g. more than one dir appears to be a template dir.
Functions for finding Cookiecutter templates and other components.
Determines which child directory of repo_dir is the project template.
Parameters: | repo_dir – Local directory of newly cloned repo. |
---|---|
Returns project_template: | |
Relative path to project template. |
Functions for generating a project from a project template.
Generates the context for a Cookiecutter project template. Loads the JSON file as a Python object, with key being the JSON filename.
Parameters: | config_file (filename) – JSON file containing project config values. |
---|
3. Write the rendered infile to outfile. :param infile: Input file to generate the file from.
Renders the templates and saves them to files. :param input_dir: Project template input directory. :paramtype input_dir: directory
Main entry point for the cookiecutter command.
The code in this module is also a good example of how to use Cookiecutter as a library rather than a script.
API equivalent to using Cookiecutter at the command line.
Parameters: | input_dir – A directory containing a project template dir, or a URL to git repo. |
---|
Entry point for the package, as defined in setup.py.
Parse the command-line arguments to Cookiecutter.