def stream_read(self, path): path = self._init_path(path) key = boto.s3.key.Key(self._s3_bucket, path) if not key.exists(): raise IOError('No such key: \'{0}\''.format(path)) while True: buf = key.read(self.buffer_size) if not buf: break yield buf
def stream_read(self, path): self._initialize_cloud_conn() path = self._init_path(path) key = self._key_class(self._cloud_bucket, path) if not key.exists(): raise IOError("No such key: '{0}'".format(path)) while True: buf = key.read(self.buffer_size) if not buf: break yield buf
def stream_read(self, path): path = self._init_path(path) key = self._s3_bucket.lookup(path) if not key: raise IOError('No such key: \'{0}\''.format(path)) if key.size > 1024 * 1024: # Use the parallel key only if the key size is > 1MB key = ParallelKey(key) while True: buf = key.read(self.buffer_size) if not buf: break yield buf
def stream_read(self, path): path = self._init_path(path) key = self._s3_bucket.lookup(path) if not key: raise IOError('No such key: \'{0}\''.format(path)) if key.size > 1024 * 1024: # Use the parallel key only if the key size is > 1MB key = ParallelKey(key, self.buffer_size) while True: buf = key.read(self.buffer_size) if not buf: break yield buf
def named_key(email, keyname): if request.method == 'PUT': key = request.files.get('key') if key: confirm_key_upload(email, keyname, key.read()) return "Key received, check email to confirm upload.\n" else: return "No key specified\n", 400 elif request.method == 'GET': key = lookup_key(email, keyname) if key: return "{0}\n".format(key) else: return "Key not found\n", 404 elif request.method == 'DELETE': key = lookup_key(email, keyname) if key: confirm_key_delete(email, keyname) return "Check your email to confirm key deletion.\n" else: return "Key not found\n", 404