Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(20)  |  Call(10)  |  Derive(0)  |  Import(10)

            @wraps(func)
    def helper(*args, **kwds):
        return GeneratorContextManager(func(*args, **kwds))
        


src/m/a/MapProxy-1.6.0/mapproxy/cache/riak.py   MapProxy(Download)
from mapproxy.image import ImageSource
from mapproxy.cache.tile import Tile
from mapproxy.cache.base import (
    TileCacheBase, FileBasedLocking,
    tile_buffer, CacheBackendError,)
    def _store_bulk(self, tiles):
        for tile in tiles:
            res = self._get_object(tile.coord)
            with tile_buffer(tile) as buf:
                data = buf.read()

src/m/a/MapProxy-1.6.0/mapproxy/cache/couchdb.py   MapProxy(Download)
 
from mapproxy.image import ImageSource
from mapproxy.cache.base import (
    TileCacheBase, FileBasedLocking,
    tile_buffer, CacheBackendError,)
        tile_doc['_id'] = tile_id
 
        with tile_buffer(tile) as buf:
            data = buf.read()
        tile_doc['_attachments'] = {

src/m/a/mapproxy-HEAD/mapproxy/cache/mbtiles.py   mapproxy(Download)
 
from mapproxy.image import ImageSource
from mapproxy.cache.base import TileCacheBase, FileBasedLocking, tile_buffer, CacheBackendError
from mapproxy.util.fs import ensure_directory
from mapproxy.util.lock import FileLock
    def store_tile(self, tile):
        if tile.stored:
            return True
        with tile_buffer(tile) as buf:
            content = buffer(buf.read())

src/m/a/mapproxy-HEAD/mapproxy/cache/riak.py   mapproxy(Download)
from mapproxy.image import ImageSource
from mapproxy.cache.tile import Tile
from mapproxy.cache.base import (
    TileCacheBase, FileBasedLocking,
    tile_buffer, CacheBackendError,)
    def _store_bulk(self, tiles):
        for tile in tiles:
            res = self._get_object(tile.coord)
            with tile_buffer(tile) as buf:
                data = buf.read()

src/m/a/mapproxy-HEAD/mapproxy/cache/couchdb.py   mapproxy(Download)
 
from mapproxy.image import ImageSource
from mapproxy.cache.base import (
    TileCacheBase, FileBasedLocking,
    tile_buffer, CacheBackendError,)
        tile_doc['_id'] = tile_id
 
        with tile_buffer(tile) as buf:
            data = buf.read()
        tile_doc['_attachments'] = {

src/m/a/MapProxy-1.6.0/mapproxy/cache/mbtiles.py   MapProxy(Download)
 
from mapproxy.image import ImageSource
from mapproxy.cache.base import TileCacheBase, FileBasedLocking, tile_buffer
from mapproxy.util.fs import ensure_directory
from mapproxy.util.lock import FileLock
    def store_tile(self, tile):
        if tile.stored:
            return True
        with tile_buffer(tile) as buf:
            content = buffer(buf.read())

src/m/a/MapProxy-1.6.0/mapproxy/cache/file.py   MapProxy(Download)
from mapproxy.util.fs import ensure_directory, write_atomic
from mapproxy.image import ImageSource, is_single_color_image
from mapproxy.cache.base import TileCacheBase, FileBasedLocking, tile_buffer
 
import logging
    def _store(self, tile, location):
        if os.path.islink(location):
            os.unlink(location)
 
        with tile_buffer(tile) as buf:

src/m/a/mapproxy-HEAD/mapproxy/cache/file.py   mapproxy(Download)
from mapproxy.util.fs import ensure_directory, write_atomic
from mapproxy.image import ImageSource, is_single_color_image
from mapproxy.cache.base import TileCacheBase, FileBasedLocking, tile_buffer
 
import logging
    def _store(self, tile, location):
        if os.path.islink(location):
            os.unlink(location)
 
        with tile_buffer(tile) as buf:

src/m/a/MapProxy-1.6.0/mapproxy/cache/sqlite.py   MapProxy(Download)
    from StringIO import StringIO
from mapproxy.image import ImageSource, is_single_color_image
from mapproxy.cache.base import tile_buffer
from mapproxy.cache.base import TileCacheBase
 
        color = is_single_color_image(tile.source.as_image())
 
        with tile_buffer(tile) as buf:
            _data = buffer(buf.read())
 

src/m/a/MapProxy-1.6.0/mapproxy/cache/meta.py   MapProxy(Download)
import struct
from mapproxy.cache.base import tile_buffer
from mapproxy.image import ImageSource
 
class MetaTileFile(object):
            for tile in tiles:
                offset = f.tell()
                with tile_buffer(tile) as buf:
                    tile_data = buf.read()
                    f.write(tile_data)