UtilBase — Base for all ADMIT utilities.

This module defines the UtilBase class.

class admit.util.UtilBase.UtilBase(**keyval)[source]

Defines the utility base class. All utility classes (e.g. Table, Line, etc) must inherit from this class. The class has the basic infrastructure for printing the class contents and setting variables. Utility classes do not have to have a write method as it is dynamically done by the xml writer.

Parameters:

keyval : dict

Dictionary containing the keyword value pairs of all arguments.

Attributes

_type (str) String containing the type of the class.
_order (list) List containing the order to write out the data in, generated on initialization.

Methods

getkey(key) Method to get a data member by name
setkey([name, value]) set keys, two styles are possible:
getkey(key)[source]

Method to get a data member by name

Parameters:

key : str

The name of the data member to return

Returns:

various, the contents of the requested item

setkey(name='', value='')[source]

set keys, two styles are possible:

  1. name = {key:val} e.g. setkey({“a”:1})
  2. name = “key”, value = val e.g. setkey(“a”, 1)

This method checks the type of the keyword value, as it must remain the same. Also new keywords cannot be added.

Parameters:

name : dictionary or string

Dictionary of keyword value pais to set or a string with the name of a single key

value : any

The value to change the keyword to

Returns:

None