Mercurial > hg > decoupage
comparison 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 |
comparison
equal
deleted
inserted
replaced
53:9c15bde43ae6 | 54:0e2b9e0507c5 |
---|---|
1 """ | |
2 pluggable formats for directory listings | |
3 """ | |
4 | |
1 try: | 5 try: |
2 import json as json | 6 import json as json |
3 except ImportError: | 7 except ImportError: |
4 import simplejson as json | 8 import simplejson as json |
5 | 9 |
10 # TODO: convert this to a class | |
6 def format_json(data): | 11 def format_json(data): |
7 | 12 |
8 # fix datetime | 13 # fix datetime |
9 for f in data['files']: | 14 for f in data['files']: |
10 f['modified'] = f['modified'].ctime() | 15 f['modified'] = f['modified'].ctime() |
11 | 16 |
12 return 'application/json', json.dumps(data['files']) | 17 return 'application/json', json.dumps(data['files']) |
13 | 18 |
19 class RSS(object): | |
20 | |
21 def __init__(self, n=10): | |
22 pass |