pygaia/utils.py
def enum(typename, field_names):
    """
    Create a new enumeration type.
  
    Code is copyright (c) Gabriel Genellina, 2010, MIT License.

    Parameters
    ----------

    typename - Name of the enumerated type
    field_names - Names of the fields of the enumerated type
    """

    if isinstance(field_names, str):
        field_names = field_names.replace(',', ' ').split()
    d = dict((reversed(nv) for nv in enumerate(field_names)), __slots__ = ())
    return type(typename, (object,), d)()
def enum(typename, field_names):
    """
    Create a new enumeration type.
  
    Code is copyright (c) Gabriel Genellina, 2010, MIT License.

    Parameters
    ----------

    typename - Name of the enumerated type
    field_names - Names of the fields of the enumerated type
    """

    if isinstance(field_names, str):
        field_names = field_names.replace(',', ' ').split()
    d = dict((reversed(nv) for nv in enumerate(field_names)), __slots__ = ())
    return type(typename, (object,), d)()
def enum ( typename , field_names ) : if isinstance ( field_names , str ) : field_names = field_names . replace ( ',' , ' ' ) . split ( ) d = dict ( ( reversed ( nv ) for nv in enumerate ( field_names ) ) , __slots__ = ( ) ) return type ( typename , ( object , ) , d ) ( )
Create a new enumeration type.
  
    Code is copyright (c) Gabriel Genellina, 2010, MIT License.

    Parameters
    ----------

    typename - Name of the enumerated type
    field_names - Names of the fields of the enumerated type
Create a new enumeration type . Code is copyright ( c ) Gabriel Genellina 2010 MIT License .