def get(self, layout, mapfile_64, z, x, y, join_field_64): self.z, self.x, self.y = map(int, [z, x, y]) self.join_field_64 =join_field_64 self.join_field = safe64.decode(join_field_64) self.filetype = 'grid.json' self.mapfile_64 = mapfile_64 if options.tile_cache and self.application._tile_cache.contains(self.mapfile_64, "%d/%d/%d.%s.%s" % (self.z, self.x, self.y, self.join_field, self.filetype)): logging.info('serving from cache') self.set_header('Content-Type', 'text/javascript') self.write(self.application._tile_cache.get(self.mapfile_64, "%d/%d/%d.%s.%s" % (self.z, self.x, self.y, self.join_field, self.filetype))) self.finish() return self.application._map_cache.get(self.mapfile_64, self, self.async_callback(self.async_get))
def get(self, data_url_64): self.get_url = safe64.decode(data_url_64) self.precache = cache.PreCache(directory=tempfile.gettempdir(), request_handler=self) self.precache.add(self.get_url) self.precache.execute(self.async_callback(self.async_get)) return "Reimplementing"
def get(self, mapfile_64, layer_id_64): self.layer_id = safe64.decode(layer_id_64) self.application._map_cache.get(mapfile_64, self, self.async_callback(self.async_get))
def fs2url(self, url): """ decode a filename to the URL it is derived from """ return safe64.decode(url)