changeset 50:d327dc7de14f

add size of file to metadata
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 03 Nov 2010 18:17:30 -0700
parents ac693b8df32c
children 8002dcdb8e82
files decoupage/web.py
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/decoupage/web.py
+++ b/decoupage/web.py
@@ -215,16 +215,17 @@ class Decoupage(object):
             filepath = os.path.join(directory, i)
             filetype = 'file'
             if os.path.isdir(filepath):
                 filetype = 'directory'
             modified = os.path.getmtime(filepath)
             modified = datetime.fromtimestamp(modified)
             files.append({'path' : '%s/%s' % (path.rstrip('/'), i),
                           'name': i,
+                          'size': os.path.getsize(filepath),
                           'modified': modified,
                           'description': conf.get(i.lower(), None),
                           'type': filetype})
         
         # TODO: deal with other links in conf
 
         return files