comparison decoupage/web.py @ 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 a2f09d749a3f
comparison
equal deleted inserted replaced
49:ac693b8df32c 50:d327dc7de14f
218 filetype = 'directory' 218 filetype = 'directory'
219 modified = os.path.getmtime(filepath) 219 modified = os.path.getmtime(filepath)
220 modified = datetime.fromtimestamp(modified) 220 modified = datetime.fromtimestamp(modified)
221 files.append({'path' : '%s/%s' % (path.rstrip('/'), i), 221 files.append({'path' : '%s/%s' % (path.rstrip('/'), i),
222 'name': i, 222 'name': i,
223 'size': os.path.getsize(filepath),
223 'modified': modified, 224 'modified': modified,
224 'description': conf.get(i.lower(), None), 225 'description': conf.get(i.lower(), None),
225 'type': filetype}) 226 'type': filetype})
226 227
227 # TODO: deal with other links in conf 228 # TODO: deal with other links in conf