Command#

class pyconverter.xml2py.ast_tree.Command(element, parse_children=True)#

Provides the command element.

Methods

Command.find(_type[, terms])

Find the first type matching a given type string.

Command.find_all(_type[, recursive, terms])

Find all types matching a given type string.

Command.get(entry)

Get an item from an element.

Command.has_children()

Return wether the element has children.

Command.print_tree()

Print the tree.

Command.rec_find(_type[, terms])

Find the first type matching a given type string recursively.

Command.to_rst([prefix])

Return a string to enable converting the element to an RST format.

Command.types_repr()

Return the string types.

Attributes

Command.added

Has the revision flag added.

Command.any_isalnum

Returns True if any characters are alphanumeric.

Command.args

Any terms immediately following the command.

Command.children

Children of the tree.

Command.command

Name of the command.

Command.content

Text content.

Command.has_args

Return whether the element has arguments.

Command.id

ID of the element.

Command.next_elem

Next element.

Command.prev_elem

Previous element.

Command.py_args

String containing the arguments of the element.

Command.py_cmd

Pythonic name of the command.

Command.raw

Raw string of the element.

Command.sphinx_cmd

String to refer to the Python command with Sphinx.

Command.tag

Element tag.

Command.tail

Tail of the element as a string.

Command.tail_no_args

Tail of the element after removing all its arguments.

Command.text_content

Text content.

Command.title

Element title.

Command.tostring

Attributes of the element as a dictionary.