Package mapproxy :: Package core :: Module cache :: Class CacheManager
[hide private]
[frames] | no frames]

Class CacheManager

source code

object --+
         |
        CacheManager

Manages tile cache and tile creation.
Instance Methods [hide private]
 
__init__(self, cache, tile_source, tile_creator)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
is_cached(self, tile)
Return True if the tile is cached.
source code
 
expire_timestamp(self, tile=None)
Return the timestamp until which a tile should be accepted as up-to-date, or None if the tiles should not expire.
source code
 
load_tile_coords(self, tile_coords, with_metadata=False)
Load all given tiles from cache.
source code
 
_load_tiles(self, tiles, with_metadata=False)
Return the given tiles with the _Tile.source set.
source code
 
_create_tiles(self, tiles, with_metadata=False)
Create the tile data for all missing tiles.
source code
 
_load_cached_tiles(self, tiles, with_metadata=False)
Set the _Tile.source for all cached tiles.
source code
 
store_tiles(self, tiles)
Store the given tiles in the underlying cache.
source code
 
__repr__(self)
repr(x)
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cache, tile_source, tile_creator)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

expire_timestamp(self, tile=None)

source code 
Return the timestamp until which a tile should be accepted as up-to-date, or None if the tiles should not expire.

Note: Returns _expire_timestamp by default.

load_tile_coords(self, tile_coords, with_metadata=False)

source code 
Load all given tiles from cache. If they are not present, load them.
Parameters:
  • tile_coords - list with tile coordinates (None for out of bounds tiles)
Returns:
list with ImageSource for all tiles (None for out of bounds tiles)

_load_tiles(self, tiles, with_metadata=False)

source code 
Return the given tiles with the _Tile.source set. If a tile is not cached, it will be created.

_create_tiles(self, tiles, with_metadata=False)

source code 
Create the tile data for all missing tiles. All created tiles will be added to the cache.
Returns:
True if new tiles were created.

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: object.__repr__
(inherited documentation)