From d7b447306ff680f45476ed41a5cddd3fe49a2540 Mon Sep 17 00:00:00 2001 From: stack Date: Wed, 11 Jul 2012 01:10:34 +0200 Subject: [PATCH] added profhandler.getProfileBaseName now the path story is somewhat more abstracted --- gui.py | 2 +- profhandler.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gui.py b/gui.py index 7b7fd57..920ee85 100644 --- a/gui.py +++ b/gui.py @@ -126,7 +126,7 @@ class Gui(QtGui.QDialog): profiles = self.profileManager.getProfilesList() for prpath in profiles: - pr = os.path.basename(prpath) + pr = self.profileManager.getBaseProfileName(prpath) receiver = self.activateProfileAction(prpath) menuItem_Profile = self.menuProfiles.addAction(pr) if self.profileManager.isCurrentProfile(prpath): diff --git a/profhandler.py b/profhandler.py index c1a30e8..5afefaa 100644 --- a/profhandler.py +++ b/profhandler.py @@ -140,11 +140,16 @@ class ProfHandler(): else: raise NotImplementedError, "Not implemented yet." except IOError as e: - raise AppError('Error on activating Profile: '+ os.path.basename(ppath)) + raise AppError('Error on activating Profile: '+ self.getBaseProfileName(ppath)) self.startDropbox() else: raise AppError("Trying to acrivate non existant profile") + def getBaseProfileName(self, ppath): + """ Returns the base name given a profile returned by getProfilesList """ + + return os.path.basename(ppath) + def getDropboxDirectory(self): pl = platform.system() if pl in ('Linux', 'Darwin'): -- 2.20.1