예제 #1
0
파일: __init__.py 프로젝트: emonty/glance
    def _open_read(self, image_meta, mode):
        image_id = image_meta['id']
        path = self.path_for_image(image_id)
        with open(path, mode) as cache_file:
            yield cache_file

        utils.inc_xattr(path, 'hits')  # bump the hit count
예제 #2
0
    def _open_read(self, image_meta, mode):
        image_id = image_meta['id']
        path = self.path_for_image(image_id)
        with open(path, mode) as cache_file:
            yield cache_file

        utils.inc_xattr(path, 'hits')  # bump the hit count
예제 #3
0
파일: __init__.py 프로젝트: Oneiroi/glance
    def open_for_read(self, image_id):
        path = self.path_for_image(image_id)
        with open(path, 'rb') as cache_file:
            yield cache_file

        utils.inc_xattr(path, 'hits')  # bump the hit count