softlayer/softlayer-object-storage-python — pull request #6 by SecurityForUs (2012-10-18 21:01:58+00:00)
Title: Fixed support for 'Range' header

While I don't think the fix is 100% 'Pythonic', it reflects the fact that there are multiple scenarios for 'Range' header: http://docs.openstack.org/trunk/openstack-object-storage/developer/content/retrieve-object.html

I wrote a testing function that simulates this to demonstrate how it works in comparison to the above link:

```python
>>> def tester(size=0,offset=0):
... if size > 0:
... if not offset:
... print "bytes=-%d" % (size-1)
... else:
... print "bytes=%d-%d" % (offset, (offset+size) - 1)
... else:
... print "bytes=%d-" % (offset)
...
>>> tester(offset=32)
bytes=32-
>>> tester(offset=5)
bytes=5-
>>> tester(5)
bytes=-4
>>> tester(5,10)
bytes=10-14
```