size = self.format_size(object['bytes'])
print('%6s %s' % (size, object['name']))
-
-
@command(api='storage')
class store_upload(_store_container_command):
"""Upload a file"""
super(store_purge, self).main()
self.client.purge_container(container)
-
@command(api='astakos')
class astakos_authenticate(object):
"""Authenticate a user"""
return reply
+ def list_containers(self):
+ self.assert_account()
+ path = '/%s' % (self.account)
+ params = dict(format='json')
+ r = self.get(path, params = params, success = (200, 204))
+ return r.json
+
def create_object(self, object, f, size=None, hash_cb=None,
upload_cb=None):
# This is a naive implementation, it loads the whole file in memory
self.assert_container()
path = '/%s/%s/%s' % (self.account, self.container, object)
self.delete(path, success=204)
-
-
- #list methods
-
- def list_containers(self):
- self.assert_container()
- path = '/%s' % (self.account)
- params = dict(format='json')
- r = self.get(path, params = params, success = (200, 204))
- return r.json
-
def list_objects(self, path=''):
self.assert_container()
path = '/%s/%s' % (self.account, self.container)
print_addresses(val.get('values', []), margin)
continue
elif key == 'servers':
- val = ', '.join(str(x) for x in val['values'])
+ val = ', '.join(unicode(x) for x in val['values'])
elif isinstance(val, dict):
if val.keys() == ['values']:
val = val['values']
def print_items(items, title=('id', 'name')):
for item in items:
- print ' '.join(str(item.pop(key)) for key in title if key in item)
+ print ' '.join(unicode(item.pop(key)) for key in title if key in item)
if item:
print_dict(item)
print