Mercurial > hg > decoupage
changeset 51:8002dcdb8e82
add "-" to list of FilenameDescription separators
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 03 Nov 2010 18:41:42 -0700 |
parents | d327dc7de14f |
children | a2f09d749a3f 9c15bde43ae6 |
files | decoupage/formatters.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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