How to use the aenum.IntFlag 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 filvarga / srv6-mobile / src / vpp-api / python / vpp_papi / vpp_serializer.py View on Github external
def __init__(self, name, msgdef, options=None):
        self.size = types['u32'].size
        self.name = name
        self.enumtype = 'u32'
        self.msgdef = msgdef
        e_hash = {}
        for f in msgdef:
            if type(f) is dict and 'enumtype' in f:
                if f['enumtype'] != 'u32':
                    self.size = types[f['enumtype']].size
                    self.enumtype = f['enumtype']
                continue
            ename, evalue = f
            e_hash[ename] = evalue
        self.enum = IntFlag(name, e_hash)
        types[name] = self
        class_types[name] = VPPEnumType
        self.options = options

aenum

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

BSD-2-Clause
Latest version published 1 year ago

Package Health Score

73 / 100
Full package analysis