Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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