Python LMF library
 All Classes Namespaces Files Functions Variables
Functions
pylmflib.pylmflib.utils.attr Namespace Reference

Functions

def check_attr_type
 Check that attribute value is of specified type. More...
 
def check_attr_range
 Check that attribute value is in specified range. More...
 
def check_date_format
 Verify that date format is composed as follows: YYYY-MM-DD (ISO 8601). More...
 
def check_time_format
 Verify that time format is composed as follows: THH:MM:SS,MSMS (ISO 8601: 'T' for Time). More...
 
def check_duration_format
 Verify that duration format is composed as follows: PTxxHxxMxxS (ISO 8601: 'P' for Period). More...
 

Function Documentation

def pylmflib.pylmflib.utils.attr.check_attr_range (   value,
  range,
  msg,
  mapping = None 
)

Check that attribute value is in specified range.

Parameters
valueThe attribute value to check.
rangeA Python set giving the range of allowed values.
msgThe message to display if value is out-of-range.
mappingA Python dictionary giving mapping between values (i.e. from MDF to LMF)
Returns
The value to set, or None if out-of-range.

Definition at line 23 of file attr.py.

def pylmflib.pylmflib.utils.attr.check_attr_type (   val,
  typ,
  msg 
)

Check that attribute value is of specified type.

Parameters
valThe attribute value to check.
typThe allowed Python type(s): simple, or Python set or list.
msgThe message to display if value is not of correct type.

Definition at line 9 of file attr.py.

def pylmflib.pylmflib.utils.attr.check_date_format (   date)

Verify that date format is composed as follows: YYYY-MM-DD (ISO 8601).

If not, display a Warning message.

Parameters
dateDate to check.

Definition at line 48 of file attr.py.

def pylmflib.pylmflib.utils.attr.check_duration_format (   duration)

Verify that duration format is composed as follows: PTxxHxxMxxS (ISO 8601: 'P' for Period).

If not, display a Warning message.

Parameters
durationDuration to check.

Definition at line 66 of file attr.py.

def pylmflib.pylmflib.utils.attr.check_time_format (   time)

Verify that time format is composed as follows: THH:MM:SS,MSMS (ISO 8601: 'T' for Time).

If not, display a Warning message.

Parameters
timeTime to check.

Definition at line 57 of file attr.py.