# HG changeset patch # User Jeff Hammel # Date 1290097146 28800 # Node ID 47acf12d01e18668c2923ef952647596ede3aab4 # Parent 0e2b9e0507c5de7a6186eb6d218e9ec1e50da528# Parent a2f09d749a3fe332e2e63b8888fc1384278ef378 merge commit diff -r a2f09d749a3f -r 47acf12d01e1 decoupage/formats.py --- a/decoupage/formats.py Tue Nov 16 21:14:25 2010 -0800 +++ b/decoupage/formats.py Thu Nov 18 08:19:06 2010 -0800 @@ -1,8 +1,13 @@ +""" +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 @@ -12,3 +17,7 @@ return 'application/json', json.dumps(data['files']) +class RSS(object): + + def __init__(self, n=10): + pass diff -r a2f09d749a3f -r 47acf12d01e1 decoupage/formatters.py --- a/decoupage/formatters.py Tue Nov 16 21:14:25 2010 -0800 +++ b/decoupage/formatters.py Thu Nov 18 08:19:06 2010 -0800 @@ -129,6 +129,7 @@ # TODO : deal with CamelCaseFilenames separators = ['_', '-'] # space substitute separators + lesser_words = [ 'or', 'a', 'the', 'on', 'of' ] # unimportant words def __call__(self, request, data): for f in data['files']: @@ -139,8 +140,9 @@ decription = description.strip('_') for separator in self.separators: if separator in description: - description = ' '.join([i.title() for i in description.split(separator)]) - + description = ' '.join([(i in self.lesser_words) and i or i.title() + for i in description.split(separator)]) + description = description[0].upper() + description[1:] f['description'] = description