The ast_tree.py
module#
Summary#
Provides the base element. |
|
Provides the itemized list element. |
|
Provides the simple itemized list element. |
|
Provides the member element for a simple itemized list. |
|
Provides the ordered list element. |
|
Provides the list item element. |
|
Provides the filename element. |
|
Provides the external link element. |
|
Provides the paragraph element. |
|
Provides the phrase element. |
|
Provides the structure name element. |
|
Provides the title element. |
|
Provides the emphasis element. |
|
Provides the example element. |
|
Provides the informal example element. |
|
Provides the GUI menu element. |
|
Provides the replaceable element. |
|
Provides the program listing element. |
|
Provides the variable list. |
|
Provides the reference section element. |
|
Provides the variable list entry element. |
|
Provides the term element. |
|
Provides the GUI label element. |
|
Provides the GUI menu item element. |
|
Provides the superscript element. |
|
Provides the code element. |
|
Provides the math element. |
|
Provides the inline equation element. |
|
Provides the subscript element. |
|
Provides the inline graphic element. |
|
Provides the quote element. |
|
Provides the link element. |
|
Provides the cross reference element. |
|
Provides the user input element. |
|
Provides the screen element. |
|
Provides the literal output element. |
|
Provides the caution element. |
|
Provides the graphic element. |
|
Provides the function element. |
|
Provides the note element. |
|
Provides the block quote element. |
|
Provides the reference metadata element. |
|
Provides the index term element. |
|
Provides the primary element. |
|
Provides the tgroup element, which contains the header and body rows of a table. |
|
Provides the table element |
|
Provides the title of the reference entry. |
|
Provides the refnamediv element, which contains the name, |
|
Provides the refname element which contains |
|
Provides the refpurpose element, which contains |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the command element. |
|
Provides the computer output element. |
|
Provides the figure element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the math element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
XML Warning element are handled the same as Caution elements. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the tbody element. |
|
Provides the entry element. |
|
Provides the row element. |
|
Provides the thead element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the base element. |
|
Provides the chapter element. |
|
Provides the base element. |
|
Provides the base element. |
|
Argument object. |
|
Provides the XML command from the documentation. |
|
Provides the informal table element. |
|
Provides the bridgehead element. |
|
Provides for loading an XML file as an AST (abstract syntax tree). |
Return a Python-compatible name for a command using the global name map. |
|
Get the values of an iterator. |
|
Get the values of a quantity iterator. |
|
Return a Python-compatible name for an argument. |
|
Get the complete argument list from a list with elipsis. |
|
Check if a name is an elipsis. |
|
String representation of the parameter types. |
|
Return the Python signature of the argument. |
|
Resize the length of a text. |
|
Split the text around a pattern. |
|
Replace terms with their definitions. |
|
Parse a single element. |
|
Parse the children of an element. |
|
Module detail#
- ast_tree.to_py_name(name, name_map=None)#
Return a Python-compatible name for a command using the global name map.
- ast_tree.get_quant_iter_pos(name: str) tuple #
Get the values of a quantity iterator.
- Parameters:
- name: str
Name of the parameter containing the iterator.
- Returns:
tuple
Tuple containing the iteration value and the position of the iterator.
- ast_tree.get_complete_args_from_initial_arg(initial_args: List[str], elipsis_args: List[str]) List[str] #
Get the complete argument list from a list with elipsis.
- Parameters:
- Returns:
list
List of complete pythonnic arguments.
Examples
>>> initial_args = ['energytype', 'cname1', 'cname2', 'cname3', 'cname4', 'cname5', 'cname6'] >>> elipsis_args = ['Cname1', ' Cname2',' …'] >>> get_complete_args_from_initial_arg(initial_args, elipsis_args) ['cname1', 'cname2', 'cname3', 'cname4', 'cname5', 'cname6']
- ast_tree.is_elipsis(name: str) bool #
Check if a name is an elipsis.
- Returns:
- bool
True if the argument is an elipsis, False otherwise.
- ast_tree.str_types(types, join_str: str) str #
String representation of the parameter types.
- Parameters:
- Returns:
str
String representation of the parameter types.
Examples
>>> types = [str, int, float] >>> str_types(types, " | ") 'str | int | float'
>>> types = [str, int] >>> str_types(types, " or ") 'str or int'
- ast_tree.to_py_signature(py_arg_name, types) str #
Return the Python signature of the argument.
- Parameters:
- Returns:
str
Python signature of the argument.
Examples
>>> py_arg_name = 'energytype' >>> types = [str, int, float] >>> to_py_signature(py_arg_name, types) 'energytype: str | int | float = ""'
- ast_tree.resize_length(text, max_length=100, initial_indent='', subsequent_indent='', list=False)#
Resize the length of a text.
- Parameters:
- Returns:
- ast_tree.get_fragment_code(initial_text, pattern)#
Split the text around a pattern.
- ast_tree.replace_asterisks_without_code(initial_text)#
- ast_tree.replace_asterisks(initial_text)#
- ast_tree.replace_terms(text, terms)#
Replace terms with their definitions.
- ast_tree.ponctuation_whitespace(text, ponctuation)#
- ast_tree.resize_element_list(text, max_length=100, initial_indent='', subsequent_indent='')#
- ast_tree.parse_element(element)#
Parse a single element.
- ast_tree.parse_children(element)#
Parse the children of an element.
- Returns:
list
List of the children of the element.
- ast_tree.get_parser()#
- ast_tree.CONV_EQN = False#
- ast_tree.XML_CLEANUP#
- ast_tree.CLEANUP#
- ast_tree.PY_ARG_CLEANUP#
- ast_tree.FORBIDDEN_ARGUMENT_NAMES = ['abs', 'char', 'class', 'dir', 'eval', 'format', 'id', 'int', 'iter', 'list', 'min', 'max',...#
- ast_tree.NAME_MAP_GLOB#
- ast_tree.NO_RESIZE_LIST = ['Variablelist', 'ItemizedList', 'SimpleList', 'Caution', 'XMLWarning', 'ProgramListing', 'Example']#
- ast_tree.MISSING_ARGUMENT_DESCRIPTION = Multiline-String#
Show Value
"""The description of the argument is missing in the Python function. Please, refer to the `command documentation
`_ for further information."""
- ast_tree.ADDITIONAL_ARGUMENT_DESCRIPTION = Multiline-String#
Show Value
"""Additional arguments can be passed to the initial command. Please, refer to the `command documentation
`_ for further information."""
- ast_tree.logger#
- ast_tree.superlatif = ['st', 'nd', 'rd', 'th']#
- ast_tree.parsers#
- ast_tree.item_needing_links_base_url#
- ast_tree.item_needing_fcache#
- ast_tree.item_needing_all#