22/04/2008

conditional paster templates

I found a few things out tonight, the most important of which is the skip_template(condition=True) command that's inserted into paster contexts. This has allowed me to reduce the code in pyglons quite a bit. There is no more "minimal_project" directory, both "pyglons_minimal" and "pyglons" templates are generated from the same "default_template" directory. Also now there is a new "pyglons_game" template which includes a splash screen over the "pyglons" template.

Ive listed the files generated by each template below:

pyglons_minimal:

./minimal/__init__.py
./minimal/lib/__init__.py
./minimal/lib/base.py
./minimal/load_config.py
./minimal/main.py
./minimal/states/__init__.py
./minimal/states/main.py
./run.py
./setup.py

pyglons:

./regular/__init__.py
./regular/lib/__init__.py
./regular/lib/base.py
./regular/load_config.py
./regular/main.py
./regular/states/__init__.py
./regular/states/help.py
./regular/states/main.py
./regular/states/menu.py
./run.py
./setup.py

pyglons_game:

./game/__init__.py
./game/lib/__init__.py
./game/lib/base.py
./game/load_config.py
./game/main.py
./game/states/__init__.py
./game/states/help.py
./game/states/main.py
./game/states/menu.py
./game/states/splash.py
./run.py
./setup.py

There is also a new option "euclid=<boolean>" which if True includes pyeuclid. At the moment this file is included in the pyglons code but hopefully will be removed to an easy_install dependency when I get the chance to email the owner and get him to change his project page slightly :)

No comments: