Module htmltextview :: Class HtmlHandler
[hide private]
[frames] | no frames]

Class HtmlHandler

source code


A handler to display html to a gtk textview

It keeps a stack of "style spans" (start/end element pairs) and a stack of list counters, for nested lists.

Instance Methods [hide private]
 
__init__(self, conv_textview, startiter) source code
 
_parse_style_color(self, tag, value) source code
 
_parse_style_background_color(self, tag, value) source code
 
_get_current_attributes(self) source code
 
__parse_length_frac_size_allocate(self, textview, allocation, frac, callback, args) source code
 
_parse_length(self, value, font_relative, block_relative, minl, maxl, callback, *args)
Parse/calc length, converting to pixels, calls callback(length, *args) when the length is first computed or changes
source code
 
_parse_style_display(self, tag, value) source code
 
_parse_style_font_size(self, tag, value) source code
 
_parse_style_font_style(self, tag, value) source code
 
__frac_length_tag_cb(self, length, tag, propname) source code
 
_parse_style_margin_left(self, tag, value) source code
 
_parse_style_margin_right(self, tag, value) source code
 
_parse_style_font_weight(self, tag, value) source code
 
_parse_style_font_family(self, tag, value) source code
 
_parse_style_text_align(self, tag, value) source code
 
_parse_style_text_decoration(self, tag, value) source code
 
_parse_style_white_space(self, tag, value) source code
 
__length_tag_cb(self, value, tag, propname) source code
 
_parse_style_width(self, tag, value) source code
 
_parse_style_height(self, tag, value) source code
 
_get_style_tags(self) source code
 
_create_url(self, href, title, type_, id_)
Process a url tag.
source code
 
_process_img(self, attrs)
Process a img tag.
source code
 
_begin_span(self, style, tag=None, id_=None) source code
 
_end_span(self) source code
 
_jump_line(self) source code
 
_insert_text(self, text) source code
 
_starts_line(self) source code
 
_flush_text(self) source code
 
_anchor_event(self, tag, textview, event, iter_, href, type_) source code
 
handle_specials(self, text) source code
 
characters(self, content)
Receive notification of character data.
source code
 
startElement(self, name, attrs)
Signals the start of an element in non-namespace mode.
source code
 
endElement(self, name)
Signals the end of an element in non-namespace mode.
source code

Inherited from xml.sax.handler.ContentHandler: endDocument, endElementNS, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElementNS, startPrefixMapping

Static Methods [hide private]
 
__parse_font_size_cb(length, tag) source code
Class Variables [hide private]
  __style_methods = dict()
Method Details [hide private]

__init__(self, conv_textview, startiter)
(Constructor)

source code 
Overrides: xml.sax.handler.ContentHandler.__init__

_parse_style_color(self, tag, value)

source code 

_parse_style_background_color(self, tag, value)

source code 

_get_current_attributes(self)

source code 

__parse_length_frac_size_allocate(self, textview, allocation, frac, callback, args)

source code 

_parse_length(self, value, font_relative, block_relative, minl, maxl, callback, *args)

source code 
Parse/calc length, converting to pixels, calls callback(length, *args) when the length is first computed or changes

__parse_font_size_cb(length, tag)
Static Method

source code 

_parse_style_display(self, tag, value)

source code 

_parse_style_font_size(self, tag, value)

source code 

_parse_style_font_style(self, tag, value)

source code 

__frac_length_tag_cb(self, length, tag, propname)

source code 

_parse_style_margin_left(self, tag, value)

source code 

_parse_style_margin_right(self, tag, value)

source code 

_parse_style_font_weight(self, tag, value)

source code 

_parse_style_font_family(self, tag, value)

source code 

_parse_style_text_align(self, tag, value)

source code 

_parse_style_text_decoration(self, tag, value)

source code 

_parse_style_white_space(self, tag, value)

source code 

__length_tag_cb(self, value, tag, propname)

source code 

_parse_style_width(self, tag, value)

source code 

_parse_style_height(self, tag, value)

source code 

_get_style_tags(self)

source code 

_create_url(self, href, title, type_, id_)

source code 
Process a url tag.

_process_img(self, attrs)

source code 
Process a img tag.

_begin_span(self, style, tag=None, id_=None)

source code 

_end_span(self)

source code 

_jump_line(self)

source code 

_insert_text(self, text)

source code 

_starts_line(self)

source code 

_flush_text(self)

source code 

_anchor_event(self, tag, textview, event, iter_, href, type_)

source code 

handle_specials(self, text)

source code 

characters(self, content)

source code 

Receive notification of character data.

The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.

Overrides: xml.sax.handler.ContentHandler.characters
(inherited documentation)

startElement(self, name, attrs)

source code 

Signals the start of an element in non-namespace mode.

The name parameter contains the raw XML 1.0 name of the element type as a string and the attrs parameter holds an instance of the Attributes class containing the attributes of the element.

Overrides: xml.sax.handler.ContentHandler.startElement
(inherited documentation)

endElement(self, name)

source code 

Signals the end of an element in non-namespace mode.

The name parameter contains the name of the element type, just as with the startElement event.

Overrides: xml.sax.handler.ContentHandler.endElement
(inherited documentation)

Class Variable Details [hide private]

__style_methods

Value:
dict()