dowski's projects - cpmyghty

cpmyghty

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

New Version for CherryPy 2.2!

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.

Files:

cp-myghty.zip
cpmyghty22.zip


Comments:

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

Add Comment:

Commenting disabled because of spam problem...

Menu:

Home
Admin

Projects:

balloondemo
brockman
buffet
buffetmyghty
buffetstring
buffetxslt
cardinfo
cp22collection
cp22simple_ajax
cp_middleware_server
cpmyghty
excuses
iresponse
littlebrother
multiauth
phpfilter
pysourcecolorfilter
queryp
request2
simplebackend
stunnelfilter
wsgi_filter

Tags:

wireless
wsgi
myghty
templating
cherrypy
ssl
python
http
library
win32
application
ajax
module
plugins
cheetah
web
filter
kid

Powered By: