How to use the aenum.IntEnum function in aenum

To help you get started, we’ve selected a few aenum examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JarryShaw / PyPCAPKit / pcapkit / const / ipv4 / tos_rel.py View on Github external
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long
"""ToS (DS Field) Reliability"""

from aenum import IntEnum, extend_enum

__all__ = ['ToSReliability']


class ToSReliability(IntEnum):
    """[ToSReliability] ToS (DS Field) Reliability"""

    NORMAL = 0

    HIGH = 1

    @staticmethod
    def get(key, default=-1):
        """Backport support for original codes."""
        if isinstance(key, int):
            return ToSReliability(key)
        if key not in ToSReliability._member_map_:  # pylint: disable=no-member
            extend_enum(ToSReliability, key, default)
        return ToSReliability[key]

    @classmethod
github NativeScript / nativescript-tooling-qa / core / enums / env.py View on Github external
"""
Environment type.
"""
from aenum import IntEnum


class EnvironmentType(IntEnum):
    _init_ = 'value string'

    PR = 0, 'pr'
    NEXT = 1, 'next'
    RC = 2, 'rc'
    LIVE = 3, 'latest'

    def __str__(self):
        return self.string
github JarryShaw / PyPCAPKit / pcapkit / const / ipv4 / qs_function.py View on Github external
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long
"""QS Functions"""

from aenum import IntEnum, extend_enum

__all__ = ['QSFunction']


class QSFunction(IntEnum):
    """[QSFunction] QS Functions"""

    Quick_Start_Request = 0

    Report_of_Approved_Rate = 8

    @staticmethod
    def get(key, default=-1):
        """Backport support for original codes."""
        if isinstance(key, int):
            return QSFunction(key)
        if key not in QSFunction._member_map_:  # pylint: disable=no-member
            extend_enum(QSFunction, key, default)
        return QSFunction[key]

    @classmethod
github OpenNebula / one / src / oca / python / pyone / __init__.py View on Github external
pass
class OneActionException(OneException):
    pass
class OneApiException(OneException):
    pass
class OneInternalException(OneException):
    pass

#
# Constants, naming follows those in Open Nebula Ruby API
#

from aenum import IntEnum

DATASTORE_TYPES = IntEnum('DATASTORE_TYPES','IMAGE SYSTEM FILE',start=0)
DATASTORE_STATES = IntEnum('DATASTORE_STATES','READY DISABLED',start=0)

DISK_TYPES = IntEnum('DISK_TYPES','FILE CD_ROM BLOCK RBD',start=0)

HISTORY_ACTION = IntEnum('HISTORY_ACTION','none migrate live-migrate shutdown shutdown-hard undeploy undeploy-hard hold release stop suspend resume boot delete delete-recreate reboot reboot-hard resched unresched poweroff poweroff-hard disk-attach disk-detach nic-attach nic-detach disk-snapshot-create disk-snapshot-delete terminate terminate-hard disk-resize deploy chown chmod updateconf rename resize update snapshot-resize snapshot-delete snapshot-revert disk-saveas disk-snapshot-revert recover retry monitor',start=0)

HOST_STATES = IntEnum('HOST_STATES','INIT MONITORING_MONITORED MONITORED ERROR DISABLED MONITORING_ERROR MONITORING_INIT MONITORING_DISABLED OFFLINE', start=0)
HOST_STATUS = IntEnum('HOST_STATUS','ENABLED DISABLED OFFLINE',start=0)

IMAGE_STATES = IntEnum('IMAGE_STATES','INIT READY USED DISABLED LOCKED ERROR CLONE DELETE USED_PERS LOCKED_USED LOCKED_USED_PERS', start=0)
IMAGE_TYPES = IntEnum('IMAGE_TYPES','OS CDROM DATABLOCK KERNEL RAMDISK CONTEXT', start=0)

LCM_STATE = IntEnum('LCM_STATE','''
            LCM_INIT
            PROLOG
            BOOT
            RUNNING
github JarryShaw / PyPCAPKit / pcapkit / const / hip / esp_transform_suite.py View on Github external
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long
"""ESP Transform Suite IDs"""

from aenum import IntEnum, extend_enum

__all__ = ['ESPTransformSuite']


class ESPTransformSuite(IntEnum):
    """[ESPTransformSuite] ESP Transform Suite IDs"""

    #: RESERVED [:rfc:`7402`]
    RESERVED = 0

    #: AES-128-CBC with HMAC-SHA1 [:rfc:`3602`][:rfc:`2404`]
    AES_128_CBC_with_HMAC_SHA1 = 1

    #: DEPRECATED [:rfc:`7402`]
    DEPRECATED_2 = 2

    #: DEPRECATED [:rfc:`7402`]
    DEPRECATED_3 = 3

    #: DEPRECATED [:rfc:`7402`]
    DEPRECATED_4 = 4
github JarryShaw / PyPCAPKit / pcapkit / const / ipv4 / option_number.py View on Github external
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long
"""IP Option Numbers"""

from aenum import IntEnum, extend_enum

__all__ = ['OptionNumber']


class OptionNumber(IntEnum):
    """[OptionNumber] IP Option Numbers"""

    #: EOOL - End of Options List [:rfc:`791`][Jon Postel]
    EOOL = 0

    #: NOP - No Operation [:rfc:`791`][Jon Postel]
    NOP = 1

    #: SEC - Security [:rfc:`1108`]
    SEC = 130

    #: LSR - Loose Source Route [:rfc:`791`][Jon Postel]
    LSR = 131

    #: TS - Time Stamp [:rfc:`791`][Jon Postel]
    TS = 68
github OpenNebula / one / src / oca / python / pyone / __init__.py View on Github external
from aenum import IntEnum

DATASTORE_TYPES = IntEnum('DATASTORE_TYPES','IMAGE SYSTEM FILE',start=0)
DATASTORE_STATES = IntEnum('DATASTORE_STATES','READY DISABLED',start=0)

DISK_TYPES = IntEnum('DISK_TYPES','FILE CD_ROM BLOCK RBD',start=0)

HISTORY_ACTION = IntEnum('HISTORY_ACTION','none migrate live-migrate shutdown shutdown-hard undeploy undeploy-hard hold release stop suspend resume boot delete delete-recreate reboot reboot-hard resched unresched poweroff poweroff-hard disk-attach disk-detach nic-attach nic-detach disk-snapshot-create disk-snapshot-delete terminate terminate-hard disk-resize deploy chown chmod updateconf rename resize update snapshot-resize snapshot-delete snapshot-revert disk-saveas disk-snapshot-revert recover retry monitor',start=0)

HOST_STATES = IntEnum('HOST_STATES','INIT MONITORING_MONITORED MONITORED ERROR DISABLED MONITORING_ERROR MONITORING_INIT MONITORING_DISABLED OFFLINE', start=0)
HOST_STATUS = IntEnum('HOST_STATUS','ENABLED DISABLED OFFLINE',start=0)

IMAGE_STATES = IntEnum('IMAGE_STATES','INIT READY USED DISABLED LOCKED ERROR CLONE DELETE USED_PERS LOCKED_USED LOCKED_USED_PERS', start=0)
IMAGE_TYPES = IntEnum('IMAGE_TYPES','OS CDROM DATABLOCK KERNEL RAMDISK CONTEXT', start=0)

LCM_STATE = IntEnum('LCM_STATE','''
            LCM_INIT
            PROLOG
            BOOT
            RUNNING
            MIGRATE
            SAVE_STOP
            SAVE_SUSPEND
            SAVE_MIGRATE
            PROLOG_MIGRATE
            PROLOG_RESUME
            EPILOG_STOP
            EPILOG
            SHUTDOWN
            CANCEL
            FAILURE
            CLEANUP_RESUBMIT
github OpenNebula / one / src / oca / python / pyone / __init__.py View on Github external
class OneNoExistsException(OneException):
    pass
class OneActionException(OneException):
    pass
class OneApiException(OneException):
    pass
class OneInternalException(OneException):
    pass

#
# Constants, naming follows those in Open Nebula Ruby API
#

from aenum import IntEnum

DATASTORE_TYPES = IntEnum('DATASTORE_TYPES','IMAGE SYSTEM FILE',start=0)
DATASTORE_STATES = IntEnum('DATASTORE_STATES','READY DISABLED',start=0)

DISK_TYPES = IntEnum('DISK_TYPES','FILE CD_ROM BLOCK RBD',start=0)

HISTORY_ACTION = IntEnum('HISTORY_ACTION','none migrate live-migrate shutdown shutdown-hard undeploy undeploy-hard hold release stop suspend resume boot delete delete-recreate reboot reboot-hard resched unresched poweroff poweroff-hard disk-attach disk-detach nic-attach nic-detach disk-snapshot-create disk-snapshot-delete terminate terminate-hard disk-resize deploy chown chmod updateconf rename resize update snapshot-resize snapshot-delete snapshot-revert disk-saveas disk-snapshot-revert recover retry monitor',start=0)

HOST_STATES = IntEnum('HOST_STATES','INIT MONITORING_MONITORED MONITORED ERROR DISABLED MONITORING_ERROR MONITORING_INIT MONITORING_DISABLED OFFLINE', start=0)
HOST_STATUS = IntEnum('HOST_STATUS','ENABLED DISABLED OFFLINE',start=0)

IMAGE_STATES = IntEnum('IMAGE_STATES','INIT READY USED DISABLED LOCKED ERROR CLONE DELETE USED_PERS LOCKED_USED LOCKED_USED_PERS', start=0)
IMAGE_TYPES = IntEnum('IMAGE_TYPES','OS CDROM DATABLOCK KERNEL RAMDISK CONTEXT', start=0)

LCM_STATE = IntEnum('LCM_STATE','''
            LCM_INIT
            PROLOG
            BOOT
github JarryShaw / PyPCAPKit / pcapkit / const / mh / packet.py View on Github external
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long
"""Mobility Header Types - for the MH Type field in the Mobility Header"""

from aenum import IntEnum, extend_enum

__all__ = ['Packet']


class Packet(IntEnum):
    """[Packet] Mobility Header Types - for the MH Type field in the Mobility Header"""

    #: Binding Refresh Request [:rfc:`6275`]
    Binding_Refresh_Request = 0

    #: Home Test Init [:rfc:`6275`]
    Home_Test_Init = 1

    #: Care-of Test Init [:rfc:`6275`]
    Care_of_Test_Init = 2

    #: Home Test [:rfc:`6275`]
    Home_Test = 3

    #: Care-of Test [:rfc:`6275`]
    Care_of_Test = 4
github JarryShaw / PyPCAPKit / pcapkit / const / ospf / authentication.py View on Github external
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long
"""Authentication Types"""

from aenum import IntEnum, extend_enum

__all__ = ['Authentication']


class Authentication(IntEnum):
    """[Authentication] Authentication Types"""

    #: No Authentication [:rfc:`1583`]
    No_Authentication = 0

    #: Simple Password Authentication [:rfc:`1583`]
    Simple_Password_Authentication = 1

    #: Cryptographic authentication [:rfc:`2328`][:rfc:`5709`]
    Cryptographic_authentication = 2

    #: Cryptographic Authentication with Extended Sequence Numbers [:rfc:`7474`]
    Cryptographic_Authentication_with_Extended_Sequence_Numbers = 3

    @staticmethod
    def get(key, default=-1):

aenum

Advanced Enumerations (compatible with Python's stdlib Enum), NamedTuples, and NamedConstants

BSD-2-Clause
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis