Mercurial > hg > decoupage
view decoupage/formats.py @ 54:0e2b9e0507c5
add documentation for formats and a stub
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 18 Nov 2010 08:18:49 -0800 |
parents | ac693b8df32c |
children | 47acf12d01e1 |
line wrap: on
line source
""" pluggable formats for directory listings """ try: import json as json except ImportError: import simplejson as json # TODO: convert this to a class def format_json(data): # fix datetime for f in data['files']: f['modified'] = f['modified'].ctime() return 'application/json', json.dumps(data['files']) class RSS(object): def __init__(self, n=10): pass