def get_allowed(self, clients, providers): allowed_points = PointList() for p in providers: allowed_points.append( ProviderPoint(p.iface) ) for c in clients: if self.is_allowed(c): for a in c.addresses: client_point = ClientPoint(a.ip) client_point.set_mac(a.mac) client_point.set_channel(c.rate.channel) allowed_points.append( client_point ) return allowed_points
class Polygon (SpatialData): def __init__ (self, data, source): SpatialData.__init__ (self, source) self.points = PointList () self.update (data) def pushPoints (self, pointList): raise NotImplementedError () def compute (self, instruction): if instruction.mode is enum.EXTERN: value = self.points.compute (instruction) if value != None: self.update ([(instruction.dst, value)]) else: try: SpatialData.compute (self, instruction) except: self.points.compute (instruction) """"def __getitem__ (self, key):
class Polygon(SpatialData): def __init__(self, data, source): SpatialData.__init__(self, source) self.points = PointList() self.update(data) def pushPoints(self, pointList): raise NotImplementedError() def compute(self, instruction): if instruction.mode is enum.EXTERN: value = self.points.compute(instruction) if value != None: self.update([(instruction.dst, value)]) else: try: SpatialData.compute(self, instruction) except: self.points.compute(instruction) """"def __getitem__ (self, key):
def __init__ (self, data, source): SpatialData.__init__ (self, source) self.points = PointList () self.update (data)
def __init__(self, data, source): SpatialData.__init__(self, source) self.points = PointList() self.update(data)