| |
- builtins.dict(builtins.object)
-
- SpecialAttributesDict
- builtins.list(builtins.object)
-
- DOMTokenList
- builtins.object
-
- AttributeNode
- AttributeNodeMap
- StyleAttribute
class AttributeNode(builtins.object) |
|
AttributeNode(name, value, ownerElement, ownerDocument=None)
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(attributesDict, ownerElement, ownerDocument=None)
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 DOMTokenList(builtins.list) |
|
DOMTokenList(*args, **kwargs)
DOMTokenList - Imitates a DOMTokenList, that is a list in normal form, but joins via " " on stringifying
and can be constructed from a string by stripping to single words and splitting by " ", ignoring empty string case |
|
- Method resolution order:
- DOMTokenList
- builtins.list
- builtins.object
Methods defined here:
- __init__(self, *args, **kwargs)
- __init__ - Create a DOMTaskList.
Can take no arguments to create empty list
Can take a list argument to use those elements in this list
Can take a string argument, and will strip whitespace and retain each distinct word as an element
- __repr__(self)
- Return repr(self).
- __str__(self)
- __str__ - String this element. Equivilant to a javascript DOMTokenList.toString(),
and will join by ' '
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.list:
- __add__(self, value, /)
- Return self+value.
- __contains__(self, key, /)
- Return key in self.
- __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).
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __gt__(self, value, /)
- Return self>value.
- __iadd__(self, value, /)
- Implement self+=value.
- __imul__(self, value, /)
- Implement self*=value.
- __iter__(self, /)
- Implement iter(self).
- __le__(self, value, /)
- Return self<=value.
- __len__(self, /)
- Return len(self).
- __lt__(self, value, /)
- Return self<value.
- __mul__(self, value, /)
- Return self*value.
- __ne__(self, value, /)
- Return self!=value.
- __reversed__(self, /)
- Return a reverse iterator over the list.
- __rmul__(self, value, /)
- Return value*self.
- __setitem__(self, key, value, /)
- Set self[key] to value.
- __sizeof__(self, /)
- Return the size of the list in memory, in bytes.
- append(self, object, /)
- Append object to the end of the list.
- clear(self, /)
- Remove all items from list.
- copy(self, /)
- Return a shallow copy of the list.
- count(self, value, /)
- Return number of occurrences of value.
- extend(self, iterable, /)
- Extend list by appending elements from the iterable.
- index(self, value, start=0, stop=9223372036854775807, /)
- Return first index of value.
Raises ValueError if the value is not present.
- insert(self, index, object, /)
- Insert object before index.
- pop(self, index=-1, /)
- Remove and return item at index (default last).
Raises IndexError if list is empty or index is out of range.
- remove(self, value, /)
- Remove first occurrence of value.
Raises ValueError if the value is not present.
- reverse(self, /)
- Reverse *IN PLACE*.
- sort(self, /, *, key=None, reverse=False)
- Stable sort *IN PLACE*.
Static methods inherited from builtins.list:
- __new__(*args, **kwargs) from builtins.type
- Create and return a new object. See help(type) for accurate signature.
Data and other attributes inherited from builtins.list:
- __hash__ = None
|
class SpecialAttributesDict(builtins.dict) |
|
SpecialAttributesDict(tag)
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:
- __contains__(self, key)
- True if the dictionary has the specified key, else False.
- __delitem__(self, key)
- __delitem__ - Called when someone does del tag.attributes['key']
@param key <str> - The attribute key to delete
- __getitem__(self, key)
- x.__getitem__(y) <==> x[y]
- __init__(self, tag)
- Initialize self. See help(type(self)) for accurate signature.
- __iter__(self)
- Implement iter(self).
- __repr__(self)
- Return repr(self).
- __setitem__(self, key, value)
- Set self[key] to value.
- get(self, key, default=None)
- get - Gets an attribute by key with the chance to provide a default value
@param key <str> - The key to query
@param default <Anything> Default None - The value to return if key is not found
@return - The value of attribute at #key, or #default if not present.
- items(self)
- D.items() -> a set-like object providing a view on D's items
- keys(self)
- D.keys() -> a set-like object providing a view on D's keys
- pop(self, key)
- 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
- setdefault(self, *args, **kwargs)
- Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- tag
- tag - Property (dot-access) for the associated tag to this attributes dict
Handles getting the value from a weak association
@return <AdvancedTag/None> - The associated tag, or None if no association
Methods inherited from builtins.dict:
- __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.
- __le__(self, value, /)
- Return self<=value.
- __len__(self, /)
- Return len(self).
- __lt__(self, value, /)
- Return self<value.
- __ne__(self, value, /)
- Return self!=value.
- __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
- popitem(...)
- D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty.
- 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
Class methods inherited from builtins.dict:
- fromkeys(iterable, value=None, /) from builtins.type
- Create a new dictionary with keys from iterable and values set to value.
Static methods inherited from builtins.dict:
- __new__(*args, **kwargs) from builtins.type
- Create and return a new object. See help(type) for accurate signature.
Data and other attributes inherited from builtins.dict:
- __hash__ = None
|
class StyleAttribute(builtins.object) |
|
StyleAttribute(styleValue, tag=None)
StyleAttribute - Represents the "style" field on a tag. |
|
Methods defined here:
- __copy__(self)
- __deepcopy__(self, memo)
- __eq__(self, other)
- __eq__ - Test if two "style" tag properties are equal.
NOTE: This differs from javascript. In javascript, no two styles equal eachother, it's
an identity comparison not a value comparison.
I don't understand how that is useful, but in a future version we may choose to adopt
that "feature" and export comparison into a different "isSaneAs(otherStyle)" function
@param other<StyleAttribute> - The other style attribute map.
- __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, tag=None)
- __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).
- isEmpty(self)
- isEmpty - Check if this is an "empty" style (no attributes set)
@return <bool> - True if no attributes are set, otherwise False
- setProperty(self, name, value)
- setProperty - Set a style property to a value.
NOTE: To remove a style, use a value of empty string, or None
@param name <str> - The style name.
NOTE: The dash names are expected here, whereas dot-access expects the camel case names.
Example: name="font-weight" versus the dot-access style.fontWeight
@param value <str> - The style value, or empty string to remove property
- setTag(self, tag)
- setTag - Set the tag association for this style.
This will handle the underlying weakref to the tag.
Call setTag(None) to clear the association, otherwise setTag(tag) to associate this style to that tag.
@param tag <AdvancedTag/None> - The new association. If None, the association is cleared, otherwise the passed tag
becomes associated with this style.
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)
- tag
- tag - Property (dot-access variable) which will return the associated tag, if any.
This method should be used for access to handle the weakref.
@see setTag - Method to set or remove the tag association
@return <AdvancedTag/None> - If a tag is associated with this style, it will be returned.
Otherwise, None will be returned
Data and other attributes defined here:
- RESERVED_ATTRIBUTES = ('_styleValue', '_styleDict', '_asStr', '_ensureHtmlAttribute', 'tag', '_tagRef', 'setTag', 'isEmpty', 'setProperty')
- __hash__ = None
| |