Inheritance diagram of Enumeration
class Enumeration(name, enumList, flaggable=False, no_doc=False)[source]

Bases: object

Enumeration class intended to provide the ‘enum’ feature present in many programming languages. The elements of the enumeration can be accessed in an “object member way” or as elements of a dictionary. Usage:

from taurus.core.util.enumeration import Enumeration

Volkswagen = Enumeration("Volkswagen",
     ("THING", 400),
     ("CABRIO", 700),

In the command line:

>>> my_car = Volkswagen.BEETLE
>>> homer_car = Volkswagen.PASSAT

>>> print Volkswagen.BEETLE

>>> print Volkswagen['BEETLE']

>>>print Volkswagen.whatis(homer_car)

Returns the element for the given key/value


Determines if the enumeration contains the given key :param key: the key :type key: str :return: True if the key is in the enumeration or False otherswise :rtype: bool


Returns an iterable containning the valid enumeration keys :return: an interable containning the valid enumeration keys :rtype: iter<str>


Returns a string representation of the value in the enumeration. :param value: a valid enumeration element :return: a string representation of the given enumeration element :rtype: str