pyui.html
index
c:\projects\pyuicvs\pyui\html.py

 
Modules
            
copy
pyui
string
traceback
 
Classes
            
exceptions.Exception
HTMLDone
HTMLError
FormatElement
FormatState
HTMLParser.HTMLParser(markupbase.ParserBase)
PyuiHTMLParser
HTMLToken
HTMLData
HTMLEndTag
HTMLTag
pyui.base.Panel(pyui.base.Base)
HTMLPanel
SpecialElement
VisibleElement
 
class FormatElement
      An element that sets the formatting mode. eg. <b> or <H1>.
An element can require that it starts on a new line, and that it is ended by a new line.
 
   Methods defined here:
__init__(self, tag, name, newlineBefore, newlineAfter, effects)
getTextSize(self, text)

Data and non-method functions defined here:
__doc__ = 'An element that sets the formatting mode. eg. <b...ew line, and that it is ended by a new line.\n '
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
__module__ = 'pyui.html'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
 
class FormatState
       
   Methods defined here:
__init__(self)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'pyui.html'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
attrs = ('bgcolor', 'align', 'valign', 'size', 'face', 'color', 'italic', 'underline', 'bold')
tuple() -> an empty tuple
tuple(sequence) -> tuple initialized from sequence's items
 
If the argument is a tuple, the return value is the same object.
 
class HTMLData(HTMLToken)
       
   Methods defined here:
__init__(self, data)
__repr__(self)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'pyui.html'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from HTMLToken:
addChild(self, child)
 
class HTMLDone(exceptions.Exception)
       
   Data and non-method functions defined here:
__doc__ = None
__module__ = 'pyui.html'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)
 
class HTMLEndTag(HTMLToken)
       
   Methods defined here:
__init__(self, tag)
__repr__(self)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'pyui.html'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from HTMLToken:
addChild(self, child)
 
class HTMLError(exceptions.Exception)
       
   Data and non-method functions defined here:
__doc__ = None
__module__ = 'pyui.html'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)
 
class HTMLPanel(pyui.base.Panel)
      Panel that displays html.
 
  
Method resolution order:
HTMLPanel
pyui.base.Panel
pyui.base.Base

Methods defined here:
__init__(self)
buildPrimatives(self)
This constructs the set of primatives for drawing the HTML
elements in this panel.
draw(self, renderer)
expandToken(self, token)
This does the work of constructing lines and primatives from
the set of tokens for the current size of the panel.
 
This is recursive through the token tree
feed(self, htmlText)
handle_charref(self, name)
handle_data(self, data)
handle_endtag(self, tag)
move back up the tree
handle_entityref(self, name)
handle_starttag(self, tag, attrs)
Add the new tag to the tree
loadFormatElements(self, renderer)
Load the format elements
loadVisibleElements(self)
Load the visible elements
popCurrentFormat(self)
processBodyTag(self, token)
pushCurrentFormat(self)
This builds a new format state based on the last format state and puts
it on the stack.
resize(self, width, height)

Data and non-method functions defined here:
__doc__ = 'Panel that displays html.\n '
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
__module__ = 'pyui.html'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from pyui.base.Panel:
_pyuiKeyDown(self, event)
addChild(self, child, option=None)
destroy(self)
getFocus(self)
nextTab(self, step=1)
pack(self)
setLayout(self, layout)

Methods inherited from pyui.base.Base:
__del__(self)
addPopup(self, popup)
calcSize(self)
This sets up self.rect to be absolute co-ordinates. also sets up self.windowRect
to be relative to the upper left of the parent Window
checkHit(self, pos)
clearDirty(self)
Clears this widgets dirty flag.
getToolTipInfo(self, pos)
return a tuple of the text and rectangle for the tooltip for when the
mouse is in <pos> within the window. This uses the member variable toolTipInfo
if it is populated.
handleEvent(self, event)
 event processing for base objects
hasFocus(self)
hit(self, pos)
Check for a hit using absolute coordinates.
loseFocus(self)
lose the gui system's focus.
move(self, dx, dy)
move relative to current position.
moveto(self, x, y)
move to absolute position.
postEvent(self, eventType)
Post an event to be processed next time through the event loop
registerEvent(self, eventType, handler)
Setup handler for an event
removeChild(self, child)
setDirty(self, collide=1)
Sets this widget to redraw itself and notifies window.
setParent(self, parent)
Set the parent of this widget
setShow(self, value)
setWindow(self, window)
unregisterEvent(self, eventType)
Remove handler for an event

Data and non-method functions inherited from pyui.base.Base:
canTab = 0
int(x[, base]) -> integer
 
Convert a string or number to an integer, if possible.  A floating point
argument will be truncated towards zero (this does not include a string
representation of a floating point number!)  When converting a string, use
the optional base.  It is an error to supply a base when converting a
non-string.
widgetLabel = 'Base'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
 
class HTMLTag(HTMLToken)
       
   Methods defined here:
__init__(self, tag, attrs)
__repr__(self)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'pyui.html'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from HTMLToken:
addChild(self, child)
 
class HTMLToken
       
   Methods defined here:
__init__(self)
__repr__(self)
addChild(self, child)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'pyui.html'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
 
class PyuiHTMLParser(HTMLParser.HTMLParser)
       
  
Method resolution order:
PyuiHTMLParser
HTMLParser.HTMLParser
markupbase.ParserBase

Methods defined here:
__init__(self, panel)
handle_charref(self, name)
handle_data(self, data)
handle_endtag(self, tag)
handle_entityref(self, name)
handle_starttag(self, tag, attrs)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'pyui.html'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from HTMLParser.HTMLParser:
check_for_whole_start_tag(self, i)
# Internal -- check to see if we have a complete starttag; return end
# or -1 if incomplete.
clear_cdata_mode(self)
close(self)
Handle any buffered data.
error(self, message)
feed(self, data)
Feed data to the parser.
 
        Call this as often as you want, with as little or as much text
        as you want (may include '
').
get_starttag_text(self)
Return full source of start tag: '<...>'.
goahead(self, end)
# Internal -- handle data as far as reasonable.  May leave state
# and data to be processed by a subsequent call.  If 'end' is
# true, force handling all data as if followed by EOF marker.
handle_comment(self, data)
# Overridable -- handle comment
handle_decl(self, decl)
# Overridable -- handle declaration
handle_pi(self, data)
# Overridable -- handle processing instruction
handle_startendtag(self, tag, attrs)
# Overridable -- finish processing of start+end tag: <tag.../>
parse_comment(self, i, report=1)
# Internal -- parse comment, return end or -1 if not terminated
parse_endtag(self, i)
# Internal -- parse endtag, return end or -1 if incomplete
parse_pi(self, i)
# Internal -- parse processing instr, return end or -1 if not terminated
parse_starttag(self, i)
# Internal -- handle starttag, return end or -1 if not terminated
reset(self)
Reset this instance.  Loses all unprocessed data.
set_cdata_mode(self)
unescape(self, s)
# Internal -- helper to remove special character quoting
unknown_decl(self, data)

Data and non-method functions inherited from HTMLParser.HTMLParser:
CDATA_CONTENT_ELEMENTS = ('script', 'style')
tuple() -> an empty tuple
tuple(sequence) -> tuple initialized from sequence's items
 
If the argument is a tuple, the return value is the same object.
_HTMLParser__starttag_text = None

Methods inherited from markupbase.ParserBase:
_parse_doctype_attlist(self, i, declstartpos)
# Internal -- scan past <!ATTLIST declarations
_parse_doctype_element(self, i, declstartpos)
# Internal -- scan past <!ELEMENT declarations
_parse_doctype_entity(self, i, declstartpos)
# Internal -- scan past <!ENTITY declarations
_parse_doctype_notation(self, i, declstartpos)
# Internal -- scan past <!NOTATION declarations
_parse_doctype_subset(self, i, declstartpos)
# Internal -- scan past the internal subset in a <!DOCTYPE declaration,
# returning the index just past any whitespace following the trailing ']'.
_scan_name(self, i, declstartpos)
# Internal -- scan a name token and the new position and the token, or
# return -1 if we've reached the end of the buffer.
getpos(self)
Return current line number and offset.
parse_declaration(self, i)
# Internal -- parse declaration (for use by subclasses).
updatepos(self, i, j)
# Internal -- update line number and offset.  This should be
# called for each piece of data exactly once, in order -- in other
# words the concatenation of all the input strings to this
# function should be exactly the entire input.

Data and non-method functions inherited from markupbase.ParserBase:
_decl_otherchars = ''
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
 
class SpecialElement
      An element with special, non-local effects. these elements dont actually draw anything.
 
   Data and non-method functions defined here:
__doc__ = 'An element with special, non-local effects. these elements dont actually draw anything.\n '
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
__module__ = 'pyui.html'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
 
class VisibleElement
      Elements that display non-textual things to the screeen.
 
   Methods defined here:
__init__(self, tag, name, newlineBefore, newlineAfter, instanceClass)

Data and non-method functions defined here:
__doc__ = 'Elements that display non-textual things to the screeen.\n '
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
__module__ = 'pyui.html'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
 
Data
             __file__ = r'.\pyui\html.pyc'
__name__ = 'pyui.html'
fontCache = {}
formatElements = [('p', 1, 1, {}, 'Paragraph'), ('h1', 1, 1, {'bold': 1, 'face': 'times', 'italic': 0, 'size': 32}, 'Heading 1'), ('h2', 1, 1, {'bold': 1, 'face': 'times', 'italic': 0, 'size': 26}, 'Heading 2'), ('h3', 1, 1, {'bold': 1, 'face': 'times', 'italic': 0, 'size': 18}, 'Heading 3'), ('b', 0, 0, {'bold': 1}, 'Bold'), ('i', 0, 0, {'italic': 1}, 'Italic'), ('br', 1, 0, {}, 'Break'), ('pre', 1, 1, {'bold': 0, 'face': 'courier', 'italic': 0, 'size': 10}, 'Preformatted'), ('li', 0, 1, {'bold': 0, 'italic': 0}, 'List Item'), ('a', 0, 0, {'underline': 1}, 'Link'), ('font', 0, 0, {}, 'Font'), ('tr', 1, 1, {}, 'Table Row'), ('td', 0, 0, {}, 'Table Cell')]
specialElements = [('body',), ('title',), ('head',), ('table',), ('html',)]
visibleElements = [('img', 0, 0, <class pyui.htmlElements.ImagePrimative at 0x008265D8>, 'Image'), ('hr', 1, 1, <class pyui.htmlElements.HRPrimative at 0x00825250>, 'Horizontal Line'), ('table', 1, 1, <class pyui.htmlElements.PrimativeTable at 0x008264F8>, 'Table')]