From 535f4592fcac1a4637350bc82bbae1d2da36ed6f Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Thu, 5 May 2011 15:59:23 +0200 Subject: [PATCH] Replace 2 regexes with a single one No functional changes Signed-off-by: Sebastian Spaeth Signed-off-by: Nicolas Sebrecht --- offlineimap/repository/LocalStatus.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/offlineimap/repository/LocalStatus.py b/offlineimap/repository/LocalStatus.py index a4e036b..5cbf77b 100644 --- a/offlineimap/repository/LocalStatus.py +++ b/offlineimap/repository/LocalStatus.py @@ -34,8 +34,9 @@ class LocalStatusRepository(BaseRepository): return '.' def getfolderfilename(self, foldername): - foldername = re.sub('/\.$', '/dot', foldername) - foldername = re.sub('^\.$', 'dot', foldername) + """Return the full path of the status file""" + # replace with 'dot' if final path name is '.' + foldername = re.sub('(^|\/)\.$','\\1dot', foldername) return os.path.join(self.directory, foldername) def makefolder(self, foldername):