Revision 16fd4b63 pithos/backends/simple.py
b/pithos/backends/simple.py | ||
---|---|---|
38 | 38 |
return {'name': account, 'count': 0, 'bytes': 0} |
39 | 39 |
contents = os.listdir(fullname) |
40 | 40 |
count = len(contents) |
41 |
size = sum((os.path.getsize(os.path.join(fullname, x)) for x in os.listdir(fullname))) |
|
41 |
size = 0 |
|
42 |
for y in (os.path.join(fullname, z) for z in contents): |
|
43 |
size += sum((os.path.getsize(os.path.join(y, x)) for x in os.listdir(y))) |
|
42 | 44 |
meta = self._get_metadata(account) |
43 | 45 |
meta.update({'name': account, 'count': count, 'bytes': size}) |
44 | 46 |
return meta |
... | ... | |
81 | 83 |
fullname = self._get_containerinfo(account, name) |
82 | 84 |
contents = os.listdir(fullname) |
83 | 85 |
count = len(contents) |
84 |
size = os.stat(fullname).st_size
|
|
86 |
size = sum((os.path.getsize(os.path.join(fullname, x)) for x in contents))
|
|
85 | 87 |
meta = self._get_metadata(os.path.join(account, name)) |
86 | 88 |
meta.update({'name': name, 'count': count, 'bytes': size}) |
87 | 89 |
return meta |
Also available in: Unified diff