[ANN] mode.py 1.0a1
Chad Whitacre
chad at zetaweb.com
Wed Nov 8 05:08:51 CET 2006
Greetings, program!
This is to announce the first public release of mode.py, a small utility
module that models the life-cycle of an application as a series of four
modes: debugging, development, staging, and production.
Quick start:
$ easy_install mode.py
...
$ python
...
>>> import mode
>>> mode.development # the default
True
>>> mode.set('production')
>>> mode.staging_or_production
True
>>>
The mode is taken from the PYTHONMODE environment variable. A more
illustrative example:
import mode
if mode.DEVELOPMENT_OR_DEBUGGING:
db = "mysql://localhost:3306/test"
elif mode.STAGING:
db = "mysql://dbserver:33000/staging"
elif mode.PRODUCTION:
db = "mysql://dbserver:33000/live"
For full documentation and downloads, see the project homepage:
http://www.zetadev.com/software/mode.py/
Thanks.
yours,
Chad Whitacre
http://www.zetadev.com/
More information about the Python-announce-list
mailing list