The templer.core package provides the core functionality of the templer code generation system. Included are a base template class, utility scripts, the templer command-line wrapper and basic templates for namespace packages, nested namespace packages and buildout recipes.
All functionality of the templer system is inherited from and extends PasteScript templates. Templates can be generated using the syntax of that package, but the templer system provides a wrapper script to make it easier for developers to generate packages.
This package provides a script, templer. The script acts as a wrapper for PasteScript's paster create, hiding the newbie-error-prone syntax ff that command. The templer script also provides some inline error-checking for project names and other variables as well as additional help. It is recommended to use this script--especially for new users--rather than using paster create directly. (The resulting packages produced, however, will be the same).
For example, to create a new basic namespace package invoke the script like so:
This will prompt you to provide a name for your package. The name you provide will be validated to ensure that it fits with the number of namespaces expected by the template you have chosen.
Once you have set the name for your new package, You will be asked to choose a set of questions to answer. By default, only the 'easy' questions are selected, allowing you to create a new package with a minimum of interaction. However, you may choose the expert set, or even choose to answer all questions if you need more control over the final output of your package.
At any time in the question-and-answer process, you may type a ? at the prompt to recieve in-line assistance with the current question.
Additional Script Functions
In addition to interactively generating code, the templer script provides a number of other useful functions:
provides full listings of the help text for the templer script.
provides a detailed list of the available templates
provides the version number of the currently installed templer package
This package provides both unit tests for code functions and doctests for each of the provided templates. If you make changes to the package, you must ensure that these tests run successfully before checking them in. Please also contribute tests for any code you create. To run the tests, execute the following:
python setup.py test
What's New in This Release: [ read full changelog ]
· Refactored test setup code for better sharing across packages [cewing]
· Fixed bug in test setup exposed by mixing doc and non-doc tests using os.getcwd() [cewing]
· Fix packaging problems and normalize setup.py [hvelarde]
· Convert to unittest2 and remove deprecated test assertion aliases [hvelarde]
· Restore support for localcommands as were present in ZopeSkel. Improve localcommands by making them optional [cewing]
· Provide exit so you can bail from a template run cleanly. Improve exit conditions throughout the templer script [cewing]
· Fixed long-standing bug in tests that showed subpackages failing when they in fact succeeded [Lazaro Clapp]
· Factor structures code into a separate method so we can use it in vars, too [cewing]