diff decoupage/formatters.py @ 17:eab191e0b9b3

meaningful descriptions from filenames
author k0s <k0scist@gmail.com>
date Sat, 26 Dec 2009 14:43:00 -0500
parents 985b3a7e0e88
children a8d36caa8f09
line wrap: on
line diff
--- a/decoupage/formatters.py	Fri Dec 25 18:57:56 2009 -0500
+++ b/decoupage/formatters.py	Sat Dec 26 14:43:00 2009 -0500
@@ -86,8 +86,10 @@
         for f in data['files']:
             if f['description'] is None:
                 description = f['name']
-                if 'strip' in self.args:
-                    description = description.rsplit('.', 1)[0]
+                description = description.rsplit('.', 1)[0]
+                decription = description.strip('_')
+                if '_' in description:
+                    description = ' '.join([i.title() for i in description.split('_')])
                 f['description'] = description