Пример #1
0
 def __init__(self,arg,internal=False):
     SHMNUM.__init__(self, arg, internal)
     if isinstance(arg,int):
         self.addr = py2shmobj.shmint_alloc()
         if self.addr is None:
             raise Exception('SHMINT allocation failed: out of memory')
         py2shmobj.shmint_set(self.addr,arg)
     elif self.addr is None:
         raise TypeError("invalid type %s assigned to SHMINT" % type(arg))
Пример #2
0
 def set(self,arg):
     SHMOBJ.protect(self)
     py2shmobj.shmint_set(self.addr,arg)