7.3.2.2.5. dsp¶
-
class
dsp
(rawsource='', *children, **attributes)[source]¶ Methods
__init__
Initialize self. append
append_attr_list
For each element in values, if it does not exist in self[attr], append it. asdom
Return a DOM fragment representation of this Node. astext
attlist
clear
coerce_append_attr_list
First, convert both self[attr] and value to a non-string sequence type; if either is not already a sequence, convert it to a list of one element. copy
copy_attr_coerce
If attr is an attribute of self and either self[attr] or value is a list, convert all non-sequence values to a sequence of 1 element and then concatenate the two sequence, setting the result to self[attr]. copy_attr_concatenate
If attr is an attribute of self and both self[attr] and value are lists, concatenate the two sequences, setting the result to self[attr]. copy_attr_consistent
If replace is True or selfpattr] is None, replace self[attr] with value. copy_attr_convert
If attr is an attribute of self, set self[attr] to [self[attr], value], otherwise set self[attr] to value. deepcopy
Return a deep copy of self (also copying children). delattr
emptytag
endtag
extend
first_child_matching_class
Return the index of the first child whose class exactly matches. first_child_not_matching_class
Return the index of the first child whose class does not match. get
get_language_code
Return node’s language tag. has_key
hasattr
index
insert
is_not_default
is_not_known_attribute
Returns True if and only if the given attribute is NOT recognized by this class. is_not_list_attribute
Returns True if and only if the given attribute is NOT one of the basic list attributes defined for all Elements. next_node
Return the first node in the iterable returned by traverse(), or None if the iterable is empty. non_default_attributes
note_referenced_by
Note that this Element has been referenced by its name name or id id. pformat
Return an indented pseudo-XML representation, for test purposes. pop
remove
replace
Replace one child Node with another child or children. replace_attr
If self[attr] does not exist or force is True or omitted, set self[attr] to value, otherwise do nothing. replace_self
Replace self node with new, where new is a node or a list of nodes. set_class
Add a new class to the “classes” attribute. setdefault
setup_child
shortrepr
starttag
traverse
Return an iterable containing update_all_atts
Updates all attributes from node or dictionary dict_. update_all_atts_coercion
Updates all attributes from node or dictionary dict_. update_all_atts_concatenating
Updates all attributes from node or dictionary dict_. update_all_atts_consistantly
Updates all attributes from node or dictionary dict_. update_all_atts_convert
Updates all attributes from node or dictionary dict_. update_basic_atts
Update basic attributes (‘ids’, ‘names’, ‘classes’, ‘dupnames’, but not ‘source’) from node or dictionary dict_. walk
Traverse a tree of Node objects, calling the dispatch_visit() method of visitor when entering each node. walkabout
Perform a tree traversal similarly to Node.walk() (which see), except also call the dispatch_departure() method before exiting each node. -
__init__
(rawsource='', *children, **attributes)¶ Initialize self. See help(type(self)) for accurate signature.
Attributes
basic_attributes
child_text_separator
document
known_attributes
line
list_attributes
local_attributes
parent
source
tagname
-