From d058c9c1092987228355cc748205bb4ad0b49a1a Mon Sep 17 00:00:00 2001 From: Julien Valroff Date: Sun, 2 Jan 2011 07:56:33 +0100 Subject: Imported Upstream version 0.3.4 --- rapid/renamesubfolderprefs.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'rapid/renamesubfolderprefs.py') diff --git a/rapid/renamesubfolderprefs.py b/rapid/renamesubfolderprefs.py index 845f809..d46a8c1 100644 --- a/rapid/renamesubfolderprefs.py +++ b/rapid/renamesubfolderprefs.py @@ -64,7 +64,6 @@ _ = Configi18n._ import datetime -import ValidatedEntry import config from common import pythonifyVersion @@ -1456,6 +1455,8 @@ class SubfolderPreferences(ImageRenamePreferences): self.component = pn.SUBFOLDER_COMPONENT ImageRenamePreferences.__init__(self, prefList, parent) + self.stripExtraneousWhiteSpace = re.compile(r'\s*%s\s*' % os.sep) + def generateNameUsingPreferences(self, photo, existingFilename=None, stripCharacters = False, fallback_date = None): """ @@ -1477,6 +1478,10 @@ class SubfolderPreferences(ImageRenamePreferences): if subfolders: if subfolders[0] == os.sep: subfolders = subfolders[1:] + + # remove any spaces before and after a directory name + if subfolders and stripCharacters: + subfolders = self.stripExtraneousWhiteSpace.sub(os.sep, subfolders) return subfolders -- cgit v1.2.3