Skip to content
Snippets Groups Projects
Commit 652116e1 authored by Michele Maris's avatar Michele Maris
Browse files

u

parent be6ad557
No related branches found
No related tags found
No related merge requests found
class struct :
""" class used to emulate a C struct, members are seen as attributes
self.keys() returns the list of elements
"""
def keys(self) :
return self.__dict__.keys()
def __setitem__(self,this,that) :
self.__dict__[this]=that
def __getitem__(self,this) :
return self.__dict__[this]
def __repr__(self) :
out=[]
for k in self.keys() :
out['('+k+':'+str(self[k])+')']
return '('+(','.join(out))+')'
def __init__(self) :
return
if od is None :
return
for k in od.keys() :
self.__dict__[k] = od[k]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment