rattail.projects.handler
Handler for Generating Projects
-
class rattail.projects.handler.ProjectHandler(config)[source]
Base class for project handlers.
-
generate_project(key, output=None, context=None, **kwargs)[source]
Generate source code for a new project, and return the path to
the output folder.
- Parameters:
key – Key identifying which type of project to generate.
output – Optional path to the output folder. If not
specified, one will be determined automatically.
context – Data dictionary with template context,
appropriate for the project type.
-
get_all_project_generators()[source]
Returns an OrderedDict
with all available project
generators.
-
get_all_project_types()[source]
Returns the list of keys for all possible project types.
-
get_project_generator(key, require=False)[source]
Returns a ProjectGenerator
instance for the given key.
If the key is not valid, returns None
unless
require=True
in which case an error is raised.
-
get_storage_dir()[source]
Returns the path to root storage (output) dir for all generated
projects.
-
get_supported_project_generators()[source]
Returns the list of “supported” project generators.
-
get_supported_project_types()[source]
Returns the list of keys for “supported” project types.
-
make_project_schema(key)[source]
Make and return a colander schema representing the context
needed for generating a project for the given key.
-
zip_output(output, zipped=None)[source]
Compress the given output folder and save as ZIP file.
- Parameters:
output – Path to the output folder.
zipped – Optional path to the final ZIP file. If not
specified, it will be the same path as output
but with
a .zip
file extension.
-
class rattail.projects.handler.RattailProjectHandler(*args, **kwargs)[source]