wiki:TraciStanPlugin

Version 2 (modified by pacopablo, 9 years ago) (diff)

--

TracIStan

Description

Interface for using Nevow Stan templates in Trac Plugins

Bugs/Feature Requests

Existing bugs and feature requests for TraciStanPlugin are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

You can check out TraciStanPlugin from here using Subversion, or browse the source with Trac.

Example

TracIStan wraps the IRequestHandler interface to allow for using Stan templates. To use it, simply subclass TracIStan and return a call to its _return(req, 'template', 'text/html') method.

from tracistan import TracIStan

class TestStan(TracIStan):
    """A simple test class illustrating usage"""

    def match_request(self, req):
        """For the sake of completeness, let's match someting"""
        return req.path_info == '/test'

    def process_request(self, req):
        """Here is where one would process all the yummy stuff"""

        # do some stuff here

        return self._return(req, 'template.stan')

Recent Changes

[1081] by pacopablo on 2006-08-02 20:36:02
TraciStanPlugin:

Add setup.cfg so that the resulting egg is tagged with the revision number and marked as dev

[1080] by pacopablo on 2006-08-02 20:33:52

TraciStanPlugin:

  • Added support for passing different structures to include()
  • Added support for using a TracIStan plugin as the default_handler. To do so, set the default_handler to TracIStan and then create a [tracistan] section and set the default_handler option to the name of the object that implements IStanRequestHandler interface. For example:
    [trac]
    default_handler = TracIStan
    
    [tracistan]
    default_handler = MyStanPlugin
    
[1061] by pacopablo on 2006-07-25 19:34:58
TraciStanPlugin:

0.9 branch

Author/Contributors

Author: pacopablo
Contributors: