Skip to main content

Core functionality for the templer tool

Project description

Introduction

This 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 basic python namespace packages and nested namespace packages.

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.

templer script

This package provides a script, templer. The script acts as a wrapper for PasteScript’s paster create, hiding the newbie-error-prone syntax of 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:

templer basic_namespace

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.

If you wish to quit the process at any time during the questions, simply enter q at the prompt.

Additional Script Functions

In addition to interactively generating code, the templer script provides a number of other useful functions:

templer --help

provides full listings of the help text for the templer script.

templer --list

provides a detailed list of the available templates

templer --version

provides the version number of the currently installed templer package

Testing

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

Contributors

  • Cris Ewing, original author

  • Lazaro Clapp

  • Hector Velarde

Based on code from zopeskel, contributors to which include:

  • Daniel Nouri

  • Tarek Ziadé

  • Mustapha Benali

  • Sylvain Viollon

  • Alan Hoey

  • Josh Johnson

  • Emanuel Sartor

  • Matthew Wilkes

  • Joel Burton

  • Cris Ewing

  • Chris Calloway

  • Chris Rossi

Changelog

1.0b4 May 17, 2012

  • 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]

1.0b3 October 6, 2011

  • relicense as MIT to keep in sync with ZopeSkel as its internals are replaced [cewing]

1.0b2 December 8, 2010

  • Fixed bug in structure system that broke template rendering when a template had no license [Cris Ewing]

  • Moved zc.buildout template recipe into new package templer.buildout [Cris Ewing]

  • Improved consistency of how templates treat ‘long_description’ in setup.py [Cris Ewing]

  • Fixed documentation references to the zopeskel script (we will call the script ‘templer’ when used from the templer packages.) [Cris Ewing]

1.0b1 December 1, 2010

  • Added structure system for better isolation of shared structural elements and improved maintainability [Cris Ewing]

  • Namespace for package changed to ‘templer’ to promote use by systems outside the Zope world [Cris Ewing]

  • Ported basic_namespace, nested_namespace and recipe templates over from zopeskel package to create core of new templer system (see http://svn.plone.org/svn/collective/ZopeSkel/branches/2.x-maintenance/SPLITTING-PROPOSAL.txt for the rationale behind this move) [Cris Ewing]

  • Package created by ZopeSkel [Cris Ewing]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

templer.core-1.0b4.zip (131.0 kB view details)

Uploaded Source

File details

Details for the file templer.core-1.0b4.zip.

File metadata

  • Download URL: templer.core-1.0b4.zip
  • Upload date:
  • Size: 131.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for templer.core-1.0b4.zip
Algorithm Hash digest
SHA256 e536b8b8cc9ab56c6755b18cdb5fe8fbd43aa83f0e39f95267d77c0f9f6dc979
MD5 e337e70f26172425fbecd04e60868bdb
BLAKE2b-256 051dcf6bba0740b9dc5a7f89de2b38a2b00d40694e3f323ee4333233559c3f01

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page