package documentation

Undocumented

Module cli Undocumented
Module color No module docstring; 0/1 variable, 1/5 function documented
Module xmlutils No module docstring; 3/7 functions documented

From __init__.py:

Class Macro Undocumented
Class NameSpace Undocumented
Class QuickLexer Undocumented
Class Table Undocumented
Class YamlDictWrapper Wrapper class providing dotted access to dict items
Class YamlListWrapper Wrapper class for yaml lists to allow recursive inheritance of wrapper property
Exception XacroException XacroException allows to wrap another exception (exc) and to augment its error message: prefixing with msg and suffixing with suffix. str(e) finally prints: msg str(exc) suffix
Function abs_filename_spec Prepend the dirname of the currently processed file if filename_spec is not yet absolute
Function check_attrs Helper routine to fetch required and optional attributes and complain about any additional attributes. :param tag (xml.dom.Element): DOM element node :param required [str]: list of required attributes :param optional [str]: list of optional attributes...
Function construct_angle_degrees utility function for converting degrees into radians from yaml
Function construct_angle_radians utility function to construct radian values from yaml
Function create_global_symbols Undocumented
Function eval_all Recursively evaluate node, expanding macros, replacing properties, and evaluating expressions
Function eval_default_arg Undocumented
Function eval_extension Undocumented
Function eval_text Undocumented
Function get_boolean_value Return a boolean value that corresponds to the given Xacro condition value. Values "true", "1" and "1.0" are supposed to be True. Values "false", "0" and "0.0" are supposed to be False. All other values raise an exception.
Function get_include_files Undocumented
Function grab_macro Undocumented
Function grab_property Undocumented
Function handle_dynamic_macro_call Undocumented
Function handle_macro_call Undocumented
Function import_xml_namespaces import all namespace declarations into parent
Function init_stacks Undocumented
Function is_valid_name Checks whether name is a valid property or macro identifier. With python-based evaluation, we need to avoid name clashes with python keywords.
Function load_yaml Undocumented
Function main Undocumented
Function open_output Undocumented
Function parse Parse input or filename into a DOM tree. If inp is None, open filename and load from there. Otherwise, parse inp, either as string or file object. If inp is already a DOM tree, this function is a noop. ...
Function parse_macro_arg parse the first param spec from a macro parameter string s accepting the following syntax: <param>[:=|=][^|]<default> :param s: param spec string :return: param, (forward, default), rest-of-string
Function print_location Undocumented
Function process_doc Undocumented
Function process_file main processing pipeline
Function process_include Undocumented
Function remove_previous_comments remove consecutive comments in front of the xacro-specific node
Function resolve_macro Undocumented
Function safe_eval Undocumented
Function tokenize Undocumented
Constant LEXER Undocumented
Variable all_includes Undocumented
Variable default_value Undocumented
Variable encoding Undocumented
Variable filestack Undocumented
Variable include_no_matches_msg Undocumented
Variable macrostack Undocumented
Variable re_macro_arg Undocumented
Variable substitution_args_context Undocumented
Variable verbosity Undocumented
Variable _empty_text_node Undocumented
Variable _global_symbols Undocumented
encoding: dict[str, str] =

Undocumented

substitution_args_context: dict =

Undocumented

filestack =

Undocumented

macrostack =

Undocumented

def init_stacks(file):

Undocumented

def abs_filename_spec(filename_spec):

Prepend the dirname of the currently processed file if filename_spec is not yet absolute

def construct_angle_radians(loader, node):

utility function to construct radian values from yaml

def construct_angle_degrees(loader, node):

utility function for converting degrees into radians from yaml

def load_yaml(filename):

Undocumented

def tokenize(s, sep=',; ', skip_empty=True):

Undocumented

def create_global_symbols():

Undocumented

def safe_eval(expr, globals, locals=None):

Undocumented

verbosity: int =

Undocumented

def check_attrs(tag, required, optional):

Helper routine to fetch required and optional attributes and complain about any additional attributes. :param tag (xml.dom.Element): DOM element node :param required [str]: list of required attributes :param optional [str]: list of optional attributes

def eval_extension(s):

Undocumented

all_includes: list =

Undocumented

include_no_matches_msg: str =

Undocumented

def get_include_files(filename_spec, symbols):

Undocumented

def import_xml_namespaces(parent, attributes):

import all namespace declarations into parent

def process_include(elt, macros, symbols, func):

Undocumented

def is_valid_name(name):

Checks whether name is a valid property or macro identifier. With python-based evaluation, we need to avoid name clashes with python keywords.

default_value: str =

Undocumented

re_macro_arg =

Undocumented

def parse_macro_arg(s):

parse the first param spec from a macro parameter string s accepting the following syntax: <param>[:=|=][^|]<default> :param s: param spec string :return: param, (forward, default), rest-of-string

forward will be either param or None (depending on whether ^ was specified) default will be the default string or None If there is no default spec at all, the middle pair will be replaced by None
def grab_macro(elt, macros):

Undocumented

def grab_property(elt, table):

Undocumented

LEXER =

Undocumented

Value
QuickLexer(DOLLAR_DOLLAR_BRACE='^\\$\\$+(\\{|\\()',
           EXPR='^\\$\\{[^\\}]*\\}',
           EXTENSION='^\\$\\([^\\)]*\\)',
           TEXT='[^$]+|\\$[^{($]+|\\$$')
def eval_text(text, symbols):

Undocumented

def eval_default_arg(forward_variable, default, symbols, macro):

Undocumented

def handle_dynamic_macro_call(node, macros, symbols):

Undocumented

def resolve_macro(fullname, macros, symbols):

Undocumented

def handle_macro_call(node, macros, symbols):

Undocumented

def get_boolean_value(value, condition):

Return a boolean value that corresponds to the given Xacro condition value. Values "true", "1" and "1.0" are supposed to be True. Values "false", "0" and "0.0" are supposed to be False. All other values raise an exception.

Parameters
valueThe value to be evaluated. The value has to already be evaluated by Xacro.
conditionThe original condition text in the XML.
Returns
The corresponding boolean value, or a Python expression that, converted to boolean, corresponds to it.
Raises
ValueErrorIf the condition value is incorrect.
_empty_text_node =

Undocumented

def remove_previous_comments(node):

remove consecutive comments in front of the xacro-specific node

def eval_all(node, macros, symbols):

Recursively evaluate node, expanding macros, replacing properties, and evaluating expressions

def parse(inp, filename=None):

Parse input or filename into a DOM tree. If inp is None, open filename and load from there. Otherwise, parse inp, either as string or file object. If inp is already a DOM tree, this function is a noop. :return:xml.dom.minidom.Document :raise: xml.parsers.expat.ExpatError

def process_doc(doc, mappings=None, **kwargs):

Undocumented

def open_output(output_filename):

Undocumented

def print_location():

Undocumented

def process_file(input_file_name, **kwargs):

main processing pipeline

_global_symbols =

Undocumented

def main():

Undocumented