Package creoleparser :: Module elements :: Class LonePlaceHolder
[hide private]
[frames] | no frames]

Class LonePlaceHolder

source code

 object --+        
          |        
WikiElement --+    
              |    
   BlockElement --+
                  |
                 LonePlaceHolder

A place holder on a line by itself or with other place holders. This is used to avoid these being enclosed in a paragraph.
Instance Methods [hide private]
 
__init__(self, tag, token, child_tags)
Constructor for WikiElement objects.
source code
 
re_string(self)
The regular expression pattern that is compiled into self.regexp.
source code
 
_build(self, mo, element_store)
Returns a genshi Element that has self.tag as the outermost tag.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

    Inherited from WikiElement
 
__repr__(self)
repr(x)
source code
 
_process(self, mo, text, wiki_elements, element_store)
Returns genshi Fragments (Elements and text)
source code
Class Variables [hide private]
  append_newline = False
Determines if newlines are appended to Element(s) during processing.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, tag, token, child_tags)
(Constructor)

source code 

Constructor for WikiElement objects.

Subclasses may have other keyword arguments.

Parameters:
  • tag - The xhtml tag associated with the element.
  • token - The character string (or strings) that identifies the element in wiki markup.
  • child_tags - A list of wiki_elements that will be searched for in the body of the element. The order of these elements matters, because if an element is found before the element that encloses it, the enclosing element will never be found. In cases where this imposes limits (e.g, strong and em should be allowed to nest each other), place the conflicting elements in a sublist. The parser will then find which comes first.
Overrides: object.__init__
(inherited documentation)

re_string(self)

source code 

The regular expression pattern that is compiled into self.regexp.

The regular expression must consume the entire wiki element, including the tokens. For block elements, the newline on the last line must be consumed also. group(1) should normally be the entire string inside the tokens. If not, a custom _build method will be needed.

Overrides: WikiElement.re_string
(inherited documentation)

_build(self, mo, element_store)

source code 

Returns a genshi Element that has self.tag as the outermost tag.

This methods if called exclusively by _process

Parameters:
  • mo - match object, usually the one returned by self.regexp.search(s)
Overrides: WikiElement._build
(inherited documentation)