Revision 085a31d7
b/tools/store | ||
---|---|---|
126 | 126 |
'IF_UNMODIFIED_SINCE':self.if_unmodified_since} |
127 | 127 |
container, sep, object = container.partition('/') |
128 | 128 |
if object: |
129 |
print '%s/%s is an object' %(container, object) |
|
130 | 129 |
return |
131 | 130 |
|
132 | 131 |
if self.until: |
... | ... | |
224 | 223 |
help='save output in file') |
225 | 224 |
parser.add_option('--version', action='store', type='str', |
226 | 225 |
dest='version', default=None, |
227 |
help='if \'list\' and in detailed mode get object\'s \ |
|
228 |
full version list otherwise get the specific \ |
|
226 |
help='get the specific \ |
|
229 | 227 |
version') |
228 |
parser.add_option('--versionlist', action='store_true', |
|
229 |
dest='versionlist', default=False, |
|
230 |
help='get the full object version list') |
|
230 | 231 |
|
231 | 232 |
def execute(self, path): |
232 | 233 |
headers = {} |
... | ... | |
238 | 239 |
for a in attrs: |
239 | 240 |
headers[a.replace('-', '_').upper()] = getattr(self, a) |
240 | 241 |
container, sep, object = path.partition('/') |
242 |
if self.versionlist: |
|
243 |
self.version = 'list' |
|
244 |
self.detail = True |
|
241 | 245 |
data = self.client.retrieve_object(container, object, self.detail, |
242 | 246 |
headers, self.version) |
243 | 247 |
f = self.file and open(self.file, 'w') or stdout |
244 | 248 |
if self.detail: |
245 | 249 |
data = json.loads(data) |
246 |
if self.version == 'list':
|
|
250 |
if self.versionlist:
|
|
247 | 251 |
print_versions(data, f=f) |
248 | 252 |
else: |
249 | 253 |
print_dict(data, f=f) |
... | ... | |
417 | 421 |
if not sep: |
418 | 422 |
dst_container = src_container |
419 | 423 |
dst_object = dst |
424 |
|
|
425 |
version = getattr(self, 'version') |
|
426 |
if version: |
|
427 |
headers = {} |
|
428 |
headers['SOURCE_VERSION'] = version |
|
420 | 429 |
self.client.move_object(src_container, src_object, dst_container, |
421 |
dst_object) |
|
430 |
dst_object, headers)
|
|
422 | 431 |
|
423 | 432 |
def print_usage(): |
424 | 433 |
cmd = Command([]) |
Also available in: Unified diff