Replace 2 regexes with a single one

No functional changes

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Sebastian Spaeth 2011-05-05 15:59:23 +02:00 committed by Nicolas Sebrecht
parent c6259fbb86
commit 535f4592fc

View File

@ -34,8 +34,9 @@ class LocalStatusRepository(BaseRepository):
return '.' return '.'
def getfolderfilename(self, foldername): def getfolderfilename(self, foldername):
foldername = re.sub('/\.$', '/dot', foldername) """Return the full path of the status file"""
foldername = re.sub('^\.$', 'dot', foldername) # replace with 'dot' if final path name is '.'
foldername = re.sub('(^|\/)\.$','\\1dot', foldername)
return os.path.join(self.directory, foldername) return os.path.join(self.directory, foldername)
def makefolder(self, foldername): def makefolder(self, foldername):