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

Class Image

source code

 object --+        
          |        
WikiElement --+    
              |    
  InlineElement --+
                  |
                 Image

Processes image elements.

>>> img = Image('img',('{{','}}'),[], delimiter='|')
>>> mo = img.regexp.search('{{ picture.jpg | An image of a house }}')
>>> img._build(mo,{}).generate().render()
'<img src="picture.jpg" alt="An image of a house"/>'
Instance Methods [hide private]
 
__init__(self, tag, token, child_tags, delimiter)
Constructor for WikiElement objects.
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 InlineElement
 
_process(self, mo, text, wiki_elements, element_store)
Returns genshi Fragments (Elements and text)
source code
 
re_string(self)
The regular expression pattern that is compiled into self.regexp.
source code
    Inherited from WikiElement
 
__repr__(self)
repr(x)
source code
Class Variables [hide private]
    Inherited from WikiElement
  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, delimiter)
(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)

_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)