Revision ed9af02c kamaki/cli/commands/image.py
b/kamaki/cli/commands/image.py | ||
---|---|---|
103 | 103 |
limit=IntArgument('limit number of listed images', ('-n', '--number')), |
104 | 104 |
more=FlagArgument( |
105 | 105 |
'output results in pages (-n to set items per page, default 10)', |
106 |
'--more') |
|
106 |
'--more'), |
|
107 |
enum=FlagArgument('Enumerate results', '--enumerate') |
|
107 | 108 |
) |
108 | 109 |
|
109 | 110 |
def _filtered_by_owner(self, detail, *list_params): |
... | ... | |
150 | 151 |
if self['more']: |
151 | 152 |
print_items( |
152 | 153 |
images, |
153 |
title=('name',), |
|
154 |
with_enumeration=True, |
|
155 |
page_size=self['limit'] or 10) |
|
154 |
with_enumeration=self['enum'], page_size=self['limit'] or 10) |
|
156 | 155 |
elif self['limit']: |
157 |
print_items( |
|
158 |
images[:self['limit']], |
|
159 |
title=('name',), |
|
160 |
with_enumeration=True) |
|
156 |
print_items(images[:self['limit']], with_enumeration=self['enum']) |
|
161 | 157 |
else: |
162 |
print_items(images, title=('name',), with_enumeration=True)
|
|
158 |
print_items(images, with_enumeration=self['enum'])
|
|
163 | 159 |
|
164 | 160 |
def main(self): |
165 | 161 |
super(self.__class__, self)._run() |
... | ... | |
355 | 351 |
limit=IntArgument('limit number listed images', ('-n', '--number')), |
356 | 352 |
more=FlagArgument( |
357 | 353 |
'output results in pages (-n to set items per page, default 10)', |
358 |
'--more') |
|
354 |
'--more'), |
|
355 |
enum=FlagArgument('Enumerate results', '--enumerate') |
|
359 | 356 |
) |
360 | 357 |
|
361 | 358 |
def _make_results_pretty(self, images): |
... | ... | |
370 | 367 |
if self['detail']: |
371 | 368 |
self._make_results_pretty(images) |
372 | 369 |
if self['more']: |
373 |
print_items(images, page_size=self['limit'] or 10) |
|
370 |
print_items( |
|
371 |
images, |
|
372 |
page_size=self['limit'] or 10, with_enumeration=self['enum']) |
|
374 | 373 |
else: |
375 |
print_items(images[:self['limit']]) |
|
374 |
print_items(images[:self['limit']], with_enumeration=self['enum'])
|
|
376 | 375 |
|
377 | 376 |
def main(self): |
378 | 377 |
super(self.__class__, self)._run() |
Also available in: Unified diff