Functions | Variables
rtsprofile.utils Namespace Reference

Functions

def _check_type (value, expected_types)
 Private functions. More...
 
def date_to_dict (date)
 Public API functions. More...
 
def get_direct_child_elements_xml (node, prefix=None, local_name=None)
 
def indent_string (string, num_spaces=2)
 
def parse_properties_xml (node)
 
def properties_to_xml (element, name, value=None)
 
def validate_attribute (attr, name, expected_type=None, required=False)
 

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.

def rtsprofile.utils.date_to_dict (   date)

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.

def rtsprofile.utils.parse_properties_xml (   node)

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: $'
private

Definition at line 22 of file utils.py.



rtsprofile
Author(s): Geoffrey Biggs
autogenerated on Fri Jun 7 2019 21:52:35