Exemplo n.º 1
0
 def add(self, obj):
     if self.closed:
         raise eimaginary.Closed(self, obj)
     containedWeight = self.getContents().getColumn("weight").sum()
     if containedWeight + obj.weight > self.capacity:
         raise eimaginary.DoesntFit(self, obj)
     assert self.thing is not None
     obj.location = self.thing
Exemplo n.º 2
0
 def remove(self, obj):
     if self.closed:
         raise eimaginary.Closed(self, obj)
     if obj.location is self.thing:
         obj.location = None