A module to ease the use of the Myghty templating language with CherryPy.
Created: 2006-02-13 | Updated: 2006-07-20 | Status: Active | Tags: python cherrypy myghty
An example is included in the archive below. See the Myghty website for information about using it as a templating language.
cpmyghty provides a Myghty template filter for CherryPy and a decorator to make assigning templates to page handlers simple. Once decorated, page handlers should return a dict() with the correct parameters for the template. The cherrypy module and is available within all templates.
It also properly displays Myghty template error pages in development mode and passes the exceptions on to CherryPy for logging or other purposes.
See the simple usage example below:
import os.path
local_dir = os.path.dirname(__file__)
from cpmyghty import MyghtyFilter, template
import cherrypy
class Test(object):
_cp_filters = [MyghtyFilter(component_root=local_dir)]
@cherrypy.expose
@template('test.myt')
def index(self):
data = {'msg':'hello'}
return data
if __name__ == '__main__':
cherrypy.tree.mount(Test(), '/')
cherrypy.server.start()
cpmyghty is free software released under the terms of the MIT license.
T Fillmore
2006-12-05
Hi, there -
At the risk of incensing the author, 8-) are there any plans for updating cpmyghty for use in CP3.X?
Thanks for all your hard work!!
Tom Fillmore
balloondemo
brockman
buffet
buffetmyghty
buffetstring
buffetxslt
cardinfo
cp22collection
cp22simple_ajax
cp_middleware_server
cpmyghty
excuses
iresponse
littlebrother
multiauth
phpfilter
pysourcecolorfilter
request2
simplebackend
stunnelfilter
wsgi_filter
wireless
wsgi
http
templating
cherrypy
ssl
python
plugins
module
win32
application
ajax
library
cheetah
myghty
filter
kid