From: stack Date: Tue, 10 Jul 2012 23:10:34 +0000 (+0200) Subject: added profhandler.getProfileBaseName X-Git-Url: https://v.licheni.net/stack/code/dboxswitch.git/commitdiff_plain/d7b447306ff680f45476ed41a5cddd3fe49a2540?ds=inline added profhandler.getProfileBaseName now the path story is somewhat more abstracted --- 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'):