Revision 614a20dc
b/kamaki/cli/commands/pithos.py | ||
---|---|---|
773 | 773 |
'do not show progress bar', ('-N', '--no-progress-bar'), |
774 | 774 |
default=False), |
775 | 775 |
start_position=IntArgument('File position in bytes', '--from'), |
776 |
end_position=IntArgument('File position in bytes', '--to') |
|
776 |
end_position=IntArgument('File position in bytes', '--to'), |
|
777 |
content_type=ValueArgument( |
|
778 |
'default: application/octet-stream', '--content-type'), |
|
777 | 779 |
) |
778 | 780 |
required = ('start_position', 'end_position') |
779 | 781 |
|
... | ... | |
793 | 795 |
start=start, |
794 | 796 |
end=end, |
795 | 797 |
source_file=f, |
798 |
content_type=self['content_type'], |
|
796 | 799 |
upload_cb=upload_cb)) |
797 | 800 |
finally: |
798 | 801 |
self._safe_progress_bar_finish(progress_bar) |
b/kamaki/clients/pithos/__init__.py | ||
---|---|---|
1381 | 1381 |
source_object=path4url(self.container, obj)) |
1382 | 1382 |
return r.headers |
1383 | 1383 |
|
1384 |
def overwrite_object(self, obj, start, end, source_file, upload_cb=None): |
|
1384 |
def overwrite_object( |
|
1385 |
self, obj, start, end, source_file, |
|
1386 |
content_type=None, upload_cb=None): |
|
1385 | 1387 |
"""Overwrite a part of an object from local source file |
1386 | 1388 |
|
1387 | 1389 |
:param obj: (str) remote object path |
... | ... | |
1392 | 1394 |
|
1393 | 1395 |
:param source_file: open file descriptor |
1394 | 1396 |
|
1397 |
:param content_type: (str) default: application/octet-stream |
|
1398 |
|
|
1395 | 1399 |
:param upload_db: progress.bar for uploading |
1396 | 1400 |
""" |
1397 | 1401 |
|
... | ... | |
1422 | 1426 |
r = self.object_post( |
1423 | 1427 |
obj, |
1424 | 1428 |
update=True, |
1425 |
content_type='application/octet-stream', |
|
1429 |
content_type=content_type or 'application/octet-stream',
|
|
1426 | 1430 |
content_length=len(block), |
1427 | 1431 |
content_range='bytes %s-%s/*' % ( |
1428 | 1432 |
start + offset, |
Also available in: Unified diff