| |
- builtins.dict(builtins.object)
-
- SpecialAttributesDict
- builtins.object
-
- AttributeNode
- AttributeNodeMap
- StyleAttribute
class AttributeNode(builtins.object) |
|
AttributeNode - A basic NamedNode implementing Attribute Node, mostly. |
|
Methods defined here:
- __eq__(self, other)
- Return self==value.
- __getattribute__(self, name)
- Return getattr(self, name).
- __getitem__(self, name)
- __hash__(self)
- Return hash(self).
- __init__(self, name, value, ownerElement, ownerDocument=None)
- Initialize self. See help(type(self)) for accurate signature.
- __ne__(self, other)
- Return self!=value.
- __repr__(self)
- Return repr(self).
- __setattr__(self, name, value)
- Implement setattr(self, name, value).
- __str__(self)
- Return str(self).
- cloneNode(self)
- cloneNode - Make a copy of this node, but not associated with the ownerElement
@return AttributeNode
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- localName
- namespaceURI
- nodeName
- nodeType
- nodeType - Return this node type (ATTRIBUTE_NODE)
- nodeValue
- nodeValue - value of this node.
- prefix
- specified
|
class AttributeNodeMap(builtins.object) |
|
AttributeNodeMap - A map of AttributeNode associated with an element.
Not very useful, I've never actually seen the "Node" interface used in practice,
but here just incase...
You probably want to just use the normal getAttribute and setAttribute on nodes... that way makes sense.
This way really doesn't make a whole lot of sense. |
|
Methods defined here:
- X__setitem__(self, name, value)
- __getattribute__(self, name)
- Return getattr(self, name).
- __getitem__(self, name)
- __init__(self, attributesDict, ownerElement, ownerDocument=None)
- Initialize self. See help(type(self)) for accurate signature.
- __iter__(self)
- __str__(self)
- Return str(self).
- getNamedItem(self, name)
- item = getNamedItem(self, name)
- setNamedItem(self, *args, **kwargs)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class SpecialAttributesDict(builtins.dict) |
|
SpecialAttributesDict - A dictionary that supports the various special members, to allow javascript-like syntax |
|
- Method resolution order:
- SpecialAttributesDict
- builtins.dict
- builtins.object
Methods defined here:
- __getitem__(self, key)
- x.__getitem__(y) <==> x[y]
- __init__(self, tag)
- Initialize self. See help(type(self)) for accurate signature.
- __setitem__(self, key, value)
- Set self[key] to value.
- get(self, key, default=None)
- D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from builtins.dict:
- __contains__(self, key, /)
- True if D has a key k, else False.
- __delitem__(self, key, /)
- Delete self[key].
- __eq__(self, value, /)
- Return self==value.
- __ge__(self, value, /)
- Return self>=value.
- __getattribute__(self, name, /)
- Return getattr(self, name).
- __gt__(self, value, /)
- Return self>value.
- __iter__(self, /)
- Implement iter(self).
- __le__(self, value, /)
- Return self<=value.
- __len__(self, /)
- Return len(self).
- __lt__(self, value, /)
- Return self<value.
- __ne__(self, value, /)
- Return self!=value.
- __new__(*args, **kwargs) from builtins.type
- Create and return a new object. See help(type) for accurate signature.
- __repr__(self, /)
- Return repr(self).
- __sizeof__(...)
- D.__sizeof__() -> size of D in memory, in bytes
- clear(...)
- D.clear() -> None. Remove all items from D.
- copy(...)
- D.copy() -> a shallow copy of D
- fromkeys(iterable, value=None, /) from builtins.type
- Returns a new dict with keys from iterable and values equal to value.
- items(...)
- D.items() -> a set-like object providing a view on D's items
- keys(...)
- D.keys() -> a set-like object providing a view on D's keys
- pop(...)
- D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised
- popitem(...)
- D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty.
- setdefault(...)
- D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
- update(...)
- D.update([E, ]**F) -> None. Update D from dict/iterable E and F.
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k]
If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v
In either case, this is followed by: for k in F: D[k] = F[k]
- values(...)
- D.values() -> an object providing a view on D's values
Data and other attributes inherited from builtins.dict:
- __hash__ = None
|
class StyleAttribute(builtins.object) |
|
StyleAttribute - Represents the "style" field on a tag. |
|
Methods defined here:
- __copy__(self)
- __deepcopy__(self, memo)
- __eq__(self, other)
- Return self==value.
- __getattribute__(self, name)
- __getattribute__ - used on dot (.) access on a Style element.
@param name <str> - The style attribute name
NOTE: This should the camelCase name (like paddingTop)
@return <str> - The attribute value or empty string if not set
- __init__(self, styleValue)
- __init__ - Create a StyleAttribute object.
@param styleValue <str> - A style string ( like "display: none; padding-top: 5px" )
- __ne__(self, other)
- Return self!=value.
- __repr__(self)
- Return repr(self).
- __setattr__(self, name, val)
- __setattr__ - Used to set an attribute using dot (.) access on a Style element
@param name <str> - The attribute name
NOTE: This must be the camelCase name (like paddingTop).
@param val <str> - The value of the attribute
- __str__(self)
- Return str(self).
- getStyle(self, styleName)
- getStyle - Gets the value of a style paramater, part of the "style" attribute
@param styleName - The name of the style
NOTE: dash-names (like padding-top) are expected here
@return - String of the value of the style. '' is no value.
- getStyleDict(self)
- getStyleDict - Returns a dictionary of style attribute name:value.
@return dict <str:str> style attribute names to values. Impl is OrderedDict and will match positioning in string value
- setStyle(self, styleName, styleValue)
- setStyle - Sets a style param. Example: "display", "block"
If you need to set many styles on an element, use setStyles instead.
It takes a dictionary of attribute, value pairs and applies it all in one go (faster)
To remove a style, set its value to empty string.
When all styles are removed, the "style" attribute will be nullified.
@param styleName - The name of the style element
@param styleValue - The value of which to assign the style element
NOTE: dash-names (like padding-top) are expected here
@return - String of current value of "style" after change is made.
- setStyles(self, styleUpdatesDict)
- setStyles - Sets one or more style params.
This all happens in one shot, so it is much much faster than calling setStyle for every value.
To remove a style, set its value to empty string.
When all styles are removed, the "style" attribute will be nullified.
@param styleUpdatesDict - Dictionary of attribute : value styles.
NOTE: dash-names (like padding-top) are expected here.
@return - String of current value of "style" after change is made.
Static methods defined here:
- camelCaseToDashName(camelCase)
- camelCaseToDashName - Convert a camel case name to a dash-name (like paddingTop to padding-top)
@param camelCase <str> - A camel-case string
@return <str> - A dash-name
- dashNameToCamelCase(dashName)
- dashNameToCamelCase - Converts a "dash name" (like padding-top) to its camel-case name ( like "paddingTop" )
@param dashName <str> - A name containing dashes
NOTE: This method is currently unused, but may be used in the future. kept for completeness.
@return <str> - The camel-case form
- styleToDict(styleStr)
- getStyleDict - Gets a dictionary of style attribute/value pairs.
NOTE: dash-names (like padding-top) are used here
@return - OrderedDict of "style" attribute.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- RESERVED_ATTRIBUTES = ('_styleValue', '_styleDict', '_asStr')
- __hash__ = None
| |