Beispiel #1
0
 def add(self,o):
     self.checkHold(o)
     if o.location():
         o.location().remove(o)
     o.location = getP(self)
     p = getP(o)
     if o not in self.contains:
         self.contains.append(p)
Beispiel #2
0
 def add(self, o):
     self.checkHold(o)
     if o.location():
         o.location().remove(o)
     o.location = getP(self)
     p = getP(o)
     if o not in self.contains:
         self.contains.append(p)
Beispiel #3
0
 def add(self,o,slot=None):
     if not slot:
         Container.add(self,o)
         return
     self.checkHoldSlot(o,slot)
     if slot in self.slots:
         other = self.slots[slot]()
         self.add(other)
     if o.location:
         o.location().remove(o)
     self.slots[slot] = getP(o)
     o.location = getP(self)
     o.locationSlot = slot
Beispiel #4
0
 def add(self, o, slot=None):
     if not slot:
         Container.add(self, o)
         return
     self.checkHoldSlot(o, slot)
     if slot in self.slots:
         other = self.slots[slot]()
         self.add(other)
     if o.location:
         o.location().remove(o)
     self.slots[slot] = getP(o)
     o.location = getP(self)
     o.locationSlot = slot
Beispiel #5
0
 def addEvent(self, time, o, name, *args, **kwargs):
     eventId = self.nextEventId
     self.nextEventId += 1
     self.events[eventId] = (self.time, self.time + time, getP(o), name,
                             args, kwargs)
     self.callLater(time, self.callEvent, eventId)
     return eventId
Beispiel #6
0
 def addEvent(self,time,o,name,*args,**kwargs):
     eventId = self.nextEventId
     self.nextEventId+=1
     self.events[eventId] = (self.time,self.time+time,getP(o),name,args,kwargs)
     self.callLater(time,self.callEvent,eventId)
     return eventId
Beispiel #7
0
 def addListener(self,listener):
     self.listeners[listener.id] = getP(listener)
Beispiel #8
0
 def addListener(self, listener):
     self.listeners[listener.id] = getP(listener)