Functions | Variables
rtsprofile::utils Namespace Reference

Functions

def _check_type
 Private functions.
def date_to_dict
 Public API functions.
def get_direct_child_elements_xml
def indent_string
def parse_properties_xml
def properties_to_xml
def validate_attribute

Variables

string __version__ = '$Revision: $'

Function Documentation

def rtsprofile.utils._check_type (   value,
  expected_types 
) [private]

Private functions.

Definition at line 122 of file utils.py.

Public API functions.

Definition at line 37 of file utils.py.

def rtsprofile.utils.get_direct_child_elements_xml (   node,
  prefix = None,
  local_name = None 
)

Definition at line 50 of file utils.py.

def rtsprofile.utils.indent_string (   string,
  num_spaces = 2 
)
Add indentation to a string.

Replaces all new lines in the string with a new line followed by the
specified number of spaces, and adds the specified number of spaces to the
start of the string.

Definition at line 65 of file utils.py.

Definition at line 77 of file utils.py.

def rtsprofile.utils.properties_to_xml (   element,
  name,
  value = None 
)

Definition at line 86 of file utils.py.

def rtsprofile.utils.validate_attribute (   attr,
  name,
  expected_type = None,
  required = False 
)
Validates that an attribute meets expectations.

This function will check if the given attribute value matches a necessary
type and/or is not None, an empty string, an empty list, etc. It will raise
suitable exceptions on validation failure.

@param attr The value to validate.
@param name The attribute name to use in exceptions.
@param expected_type The type the value must be. If None, no check is
performed. If a list, attr must match one type in the list.
@param required If the value must not be empty, e.g. not an empty string.
@raises InvalidTypeError
@raises RequiredAttributeError

Definition at line 92 of file utils.py.


Variable Documentation

string rtsprofile::utils::__version__ = '$Revision: $'

Definition at line 22 of file utils.py.



rtsprofile
Author(s): Geoffrey Biggs
autogenerated on Sun Mar 26 2017 03:39:43