from operationscore.PixelMapper import * import util.Geo as Geo class SimpleMapper(PixelMapper): def mappingFunction(self, eventLocation, screen): if type(eventLocation) == type(tuple()): bestDist = 10**10 #don't kill me, I'm lazy bestPixel = None for pixel in screen: pixelDist = Geo.dist(pixel.location, eventLocation) if pixelDist < bestDist: bestPixel = pixel bestDist = pixelDist return [(bestPixel,1)] elif type(type(str)): #[{x}>5,{y}