# HG changeset patch # User Jeff Hammel # Date 1288921890 25200 # Node ID 9c15bde43ae6db6e0a1119e2d373beee46ce4e50 # Parent 8002dcdb8e82faf5156e555fc4b16726412a497a dont capitalize unimportant words diff -r 8002dcdb8e82 -r 9c15bde43ae6 decoupage/formatters.py --- a/decoupage/formatters.py Wed Nov 03 18:41:42 2010 -0700 +++ b/decoupage/formatters.py Thu Nov 04 18:51:30 2010 -0700 @@ -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