# HG changeset patch # User Jeff Hammel # Date 1288834902 25200 # Node ID 8002dcdb8e82faf5156e555fc4b16726412a497a # Parent d327dc7de14f490ca8cc6bcfe0de1ed14177bf91 add "-" to list of FilenameDescription separators diff -r d327dc7de14f -r 8002dcdb8e82 decoupage/formatters.py --- a/decoupage/formatters.py Wed Nov 03 18:17:30 2010 -0700 +++ b/decoupage/formatters.py Wed Nov 03 18:41:42 2010 -0700 @@ -128,6 +128,8 @@ """ # TODO : deal with CamelCaseFilenames + separators = ['_', '-'] # space substitute separators + def __call__(self, request, data): for f in data['files']: if f['description'] is None: @@ -135,8 +137,10 @@ if '.' in description: description = description.rsplit('.', 1)[0] decription = description.strip('_') - if '_' in description: - description = ' '.join([i.title() for i in description.split('_')]) + for separator in self.separators: + if separator in description: + description = ' '.join([i.title() for i in description.split(separator)]) + f['description'] = description