diff --git a/application.py b/application.py index a7b2a87..ab80a92 100755 --- a/application.py +++ b/application.py @@ -655,6 +655,18 @@ class Application(object): f = getattr(self.window(), methodname) f() + # build application-centric paths + def getpath(self, *parts): + return os.path.join(os.getenv('HOME'), '.pmc', *parts) + + # create directories under the application path + def mkdirs(self, *parts): + path = self.getpath() + for part in parts: + path = os.path.join(path, part) + if not os.path.exists(path): + os.mkdir(path) + # load user configuration NOW def loadrc(self): path = os.path.join(os.getenv('HOME'), '.pmc', 'conf')