Revision 83894828
b/pithos/backends/dummy.py | ||
---|---|---|
46 | 46 |
raise NameError('Account does not exist') |
47 | 47 |
contents = os.listdir(fullname) |
48 | 48 |
count = len(contents) |
49 |
size = sum(os.path.getsize(os.path.join(self.basepath, account, objectname)) for objectname in contents)
|
|
49 |
size = os.stat(fullname).st_size
|
|
50 | 50 |
meta = self.__get_metadata(account) |
51 | 51 |
meta.update({'name': account, 'count': count, 'bytes': size}) |
52 | 52 |
return meta |
... | ... | |
315 | 315 |
else: |
316 | 316 |
link = self.con.execute('insert into objects (name) values (?)', (path,)).lastrowid |
317 | 317 |
for k, v in meta.iteritems(): |
318 |
if type(v) != types.StringType: |
|
319 |
v = json.dumps(v) |
|
318 | 320 |
self.con.execute('insert or replace into metadata (object_id, name, value) values (?, ?, ?)', (link, k, v)) |
319 | 321 |
self.con.commit() |
320 | 322 |
return |
Also available in: Unified diff