Browse files

Added extra header option to object's read()

  • Loading branch information...
1 parent ed3da1d commit 708e086ff5c110b675566e3fec65de71a3430865 @sudorandom sudorandom committed Apr 24, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 object_storage/storage_object.py
View
4 object_storage/storage_object.py
@@ -208,15 +208,15 @@ def delete(self, recursive=False):
"""
return self.client.delete_object(self.container, self.name)
- def read(self, size=0, offset=0):
+ def read(self, size=0, offset=0, headers=None):
""" Reads object content
@param size: number of bytes to read (0 reads all of the object data)
@param offset: number of bytes to offset the read
@raises ResponseError
@return: str, data
"""
- headers = {}
+ headers = headers or {}
if size > 0:
_range = 'bytes=%d-%d' % (offset, (offset + size) - 1)
headers['Range'] = _range

0 comments on commit 708e086

Please sign in to comment.