Revision ed9af02c kamaki/cli/commands/pithos.py
b/kamaki/cli/commands/pithos.py | ||
---|---|---|
328 | 328 |
'--more'), |
329 | 329 |
exact_match=FlagArgument( |
330 | 330 |
'Show only objects that match exactly with path', |
331 |
'--exact-match') |
|
331 |
'--exact-match'), |
|
332 |
enum=FlagArgument('Enumerate results', '--enumerate') |
|
332 | 333 |
) |
333 | 334 |
|
334 | 335 |
def print_objects(self, object_list): |
... | ... | |
348 | 349 |
size = format_size(obj['bytes']) |
349 | 350 |
pretty_obj['bytes'] = '%s (%s)' % (obj['bytes'], size) |
350 | 351 |
oname = bold(obj['name']) |
352 |
prfx = ('%s%s. ' % (empty_space, index)) if self['enum'] else '' |
|
351 | 353 |
if self['detail']: |
352 |
print('%s%s. %s' % (empty_space, index, oname))
|
|
354 |
print('%s%s' % (prfx, oname))
|
|
353 | 355 |
print_dict(pretty_keys(pretty_obj), exclude=('name')) |
354 | 356 |
|
355 | 357 |
else: |
356 |
oname = '%s%s. %6s %s' % (empty_space, index, size, oname)
|
|
358 |
oname = '%s%9s %s' % (prfx, size, oname)
|
|
357 | 359 |
oname += '/' if isDir else '' |
358 | 360 |
print(oname) |
359 | 361 |
if self['more']: |
... | ... | |
365 | 367 |
for index, container in enumerate(container_list): |
366 | 368 |
if 'bytes' in container: |
367 | 369 |
size = format_size(container['bytes']) |
368 |
cname = '%s. %s' % (index + 1, bold(container['name'])) |
|
370 |
prfx = ('%s. ' % (index + 1)) if self['enum'] else '' |
|
371 |
cname = '%s%s' % (prfx, bold(container['name'])) |
|
369 | 372 |
if self['detail']: |
370 | 373 |
print(cname) |
371 | 374 |
pretty_c = container.copy() |
Also available in: Unified diff