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

Class templessnode

source code

object --+        
         |        
      list --+    
             |    
object --+   |    
         |   |    
      node --+    
             |    
        elnode --+
                 |
                templessnode

templess element node

has a special method 'convert' that makes it conver itself to a normal elnode by processing all templess directives (returns a new node, doesn't process in-place)

Instance Methods [hide private]
  __init__(self, name, attrs, parent, t_prefix, charset='UTF-8')
  convert(self, context, parent=None)
process the templess directives
  _handle_cond(self, attrs, context)
handle the 't:cond' and 't:not' directives
  _process_attr(self, attrs, context)
  _get_replace(self, attrs)
  _get_content(self, attrs)

Inherited from elnode: __repr__, find, generate, unicode

Inherited from list: __add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __hash__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __reversed__, __rmul__, __setitem__, __setslice__, append, count, extend, index, insert, pop, remove, reverse, sort

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__, __str__


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, name, attrs, parent, t_prefix, charset='UTF-8')
(Constructor)

source code 
None
Overrides: elnode.__init__

convert(self, context, parent=None)

source code 

process the templess directives

returns a copy of self, or a list of copies of self (in case of t:content), can return unexpected results in case of t:replace, use only on root nodes of documents in production situation (iow: if you want to convert a tree, always make sure there's no t:repeat on the node you call convert() on)

context is a context dict (see docs), parent is an internal helper argument

_handle_cond(self, attrs, context)

source code 

handle the 't:cond' and 't:not' directives

returns False if there's a t:cond or t:not that doesn't allow rendering, True otherwise

_process_attr(self, attrs, context)

source code 
None

_get_replace(self, attrs)

source code 
None

_get_content(self, attrs)

source code 
None