Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Private Member Functions | Static Private Attributes
MoinMoin.widget.html.Element Class Reference
Inheritance diagram for MoinMoin.widget.html.Element:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def tagname
def __unicode__

Public Attributes

 attrs

Private Member Functions

def _openingtag

Static Private Attributes

dictionary _ATTRS
dictionary _DEFAULT_ATTRS
dictionary _BOOL_ATTRS

Detailed Description

Abstract base class for HTML elements.

Definition at line 39 of file html.py.


Constructor & Destructor Documentation

def MoinMoin.widget.html.Element.__init__ (   self,
  kw 
)

Reimplemented in MoinMoin.widget.html.CompositeElement.

Definition at line 61 of file html.py.

00061 
00062     def __init__(self, **kw):
00063         for key in kw:
00064             key = key.lower()
00065             if key not in self._ATTRS:
00066                 raise AttributeError(
00067                     "Invalid HTML attribute %r for tag <%s>" % (
00068                         key, self.tagname()))
00069 
00070         self.attrs = self._DEFAULT_ATTRS.copy()
00071         self.attrs.update(kw)

Here is the call graph for this function:


Member Function Documentation

Reimplemented in MoinMoin.widget.html.CompositeElement, and MoinMoin.widget.html.EmptyElement.

Definition at line 89 of file html.py.

00089 
00090     def __unicode__(self):
00091         raise NotImplementedError
00092 

def MoinMoin.widget.html.Element._openingtag (   self) [private]

Reimplemented in MoinMoin.widget.html.LABEL.

Definition at line 75 of file html.py.

00075 
00076     def _openingtag(self):
00077         result = [self.tagname()]
00078         attrs = self.attrs.items()
00079         if _SORT_ATTRS:
00080             attrs.sort()
00081         for key, val in attrs:
00082             key = key.lower()
00083             if key in self._BOOL_ATTRS:
00084                 if val:
00085                     result.append(key)
00086             else:
00087                 result.append(u'%s="%s"' % (key, wikiutil.escape(val, 1)))
00088         return ' '.join(result)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 72 of file html.py.

00072 
00073     def tagname(self):
00074         return self.__class__.__name__.lower()

Here is the caller graph for this function:


Member Data Documentation

dictionary MoinMoin.widget.html.Element._ATTRS [static, private]
Initial value:
{
    }

Reimplemented in MoinMoin.widget.html.VAR, MoinMoin.widget.html.UL, MoinMoin.widget.html.TT, MoinMoin.widget.html.TR, MoinMoin.widget.html.TITLE, MoinMoin.widget.html.THEAD, MoinMoin.widget.html.TH, MoinMoin.widget.html.TFOOT, MoinMoin.widget.html.TEXTAREA, MoinMoin.widget.html.TD, MoinMoin.widget.html.TBODY, MoinMoin.widget.html.TABLE, MoinMoin.widget.html.SUP, MoinMoin.widget.html.SUB, MoinMoin.widget.html.STYLE, MoinMoin.widget.html.STRONG, MoinMoin.widget.html.SPAN, MoinMoin.widget.html.SMALL, MoinMoin.widget.html.SELECT, MoinMoin.widget.html.SCRIPT, MoinMoin.widget.html.SAMP, MoinMoin.widget.html.Q, MoinMoin.widget.html.PRE, MoinMoin.widget.html.P, MoinMoin.widget.html.OPTION, MoinMoin.widget.html.OPTGROUP, MoinMoin.widget.html.OL, MoinMoin.widget.html.NOSCRIPT, MoinMoin.widget.html.META, MoinMoin.widget.html.MAP, MoinMoin.widget.html.LINK, MoinMoin.widget.html.LI, MoinMoin.widget.html.LABEL, MoinMoin.widget.html.KBD, MoinMoin.widget.html.INS, MoinMoin.widget.html.INPUT, MoinMoin.widget.html.IMG, MoinMoin.widget.html.IFRAME, MoinMoin.widget.html.I, MoinMoin.widget.html.HTML, MoinMoin.widget.html.HR, MoinMoin.widget.html.HEAD, MoinMoin.widget.html.H6, MoinMoin.widget.html.H5, MoinMoin.widget.html.H4, MoinMoin.widget.html.H3, MoinMoin.widget.html.H2, MoinMoin.widget.html.H1, MoinMoin.widget.html.FORM, MoinMoin.widget.html.EM, MoinMoin.widget.html.DT, MoinMoin.widget.html.DL, MoinMoin.widget.html.DIV, MoinMoin.widget.html.DFN, MoinMoin.widget.html.DEL, MoinMoin.widget.html.DD, MoinMoin.widget.html.CODE, MoinMoin.widget.html.CITE, MoinMoin.widget.html.CAPTION, MoinMoin.widget.html.BUTTON, MoinMoin.widget.html.BR, MoinMoin.widget.html.BODY, MoinMoin.widget.html.BLOCKQUOTE, MoinMoin.widget.html.BIG, MoinMoin.widget.html.BDO, MoinMoin.widget.html.BASE, MoinMoin.widget.html.B, MoinMoin.widget.html.AREA, MoinMoin.widget.html.ADDRESS, MoinMoin.widget.html.ACRONYM, MoinMoin.widget.html.ABBR, and MoinMoin.widget.html.A.

Definition at line 43 of file html.py.

dictionary MoinMoin.widget.html.Element._BOOL_ATTRS [static, private]
Initial value:
{
        'checked': None,
        'compact': None,
        'defer': None,
        'disabled': None,
        'ismap': None,
        'multiple': None,
        'nohref': None,
        'noshade': None,
        'nowrap': None,
        'readonly': None,
        'selected': None,
    }

Definition at line 47 of file html.py.

dictionary MoinMoin.widget.html.Element._DEFAULT_ATTRS [static, private]
Initial value:
{
    }

Reimplemented in MoinMoin.widget.html.FORM.

Definition at line 45 of file html.py.

Definition at line 69 of file html.py.


The documentation for this class was generated from the following file: