Package dap :: Package responses :: Package html :: Module templess
[hide private]
[frames] | no frames]

Module templess

source code

Copyright (c) 2005-2006 Guido Wesdorp. All rights reserved. This software is distributed under the terms of the Templess License. See LICENSE.txt for license text. E-mail: johnny@johnnydebris.net

A very compact, XML based templating system. It has only 5 different directives, and doesn't allow any logic inside the templates, but instead expects the application to provide a dict with all the data (as strings or XML nodes) completely prepared. This makes it quite restrictive, and harder to seperately work on design and logic (the template has to very strictly adhere to the format of the dict), but makes it an environment extremely suitable for developers (since all development is done from code rather than from the template, and they don't have to learn a new, quirky templating language).

Classes [hide private]
  xmlstring
wrapper around unicode to mark a string as XML
  objectcontext
wrapper around objects to allow Templess to traverse attributes...
  node
node base
  elnode
XML element
  templessnode
templess element node
  textnode
text element
  cdatanode
cdata node
  commentnode
comment node
  treebuilderhandler
nanosax handler to convert XML to a node tree
  template
a Templess template
  cgitemplate
simple cgi engine for serving templess templates

Functions [hide private]
  iterwrapper(iterable)
  is_iterable_not_string(v)
determine if something is iterable but not a string
  entitize(s)
entitize a string so it can be used in XML content and attrs

Variables [hide private]
  __appname__ = 'templess'
  __version__ = '0.2'
  __author__ = 'Guido Wesdorp <johnny@johnnydebris.net>'
  __last_modified_date__ = '$Date: 2006-10-06 13:20:37 +0200 (Fri, 06 Oct 2006) $'
  __last_author__ = '$Author: johnny $'
  __revision__ = '$Revision: 86 $'
  __footer__ = 'templess v0.2, (c) Guido Wesdorp <johnny@johnnydebr...
  XMLNS = 'http://johnnydebris.net/xmlns/templess'
  xml = open(sys.argv [1]).read()
  handler = treebuilderhandler('UTF-8')
  parser = nanosax.nsparser(handler)

Imports: nanosax, sys


Function Details [hide private]

iterwrapper(iterable)

source code 
None

is_iterable_not_string(v)

source code 
determine if something is iterable but not a string

entitize(s)

source code 
entitize a string so it can be used in XML content and attrs

Variables Details [hide private]

__appname__

None
Value:
'templess'                                                             
      

__version__

None
Value:
'0.2'                                                                  
      

__author__

None
Value:
'Guido Wesdorp <johnny@johnnydebris.net>'                              
      

__last_modified_date__

None
Value:
'$Date: 2006-10-06 13:20:37 +0200 (Fri, 06 Oct 2006) $'                
      

__last_author__

None
Value:
'$Author: johnny $'                                                    
      

__revision__

None
Value:
'$Revision: 86 $'                                                      
      

__footer__

None
Value:
'templess v0.2, (c) Guido Wesdorp <johnny@johnnydebris.net> 2005'      
      

XMLNS

None
Value:
'http://johnnydebris.net/xmlns/templess'                               
      

xml

None
Value:
open(sys.argv [1]).read()                                              
      

handler

None
Value:
treebuilderhandler('UTF-8')                                            
      

parser

None
Value:
nanosax.nsparser(handler)