added methods for working with ~/.pmc/XYZ paths
--HG-- branch : pmacs2
This commit is contained in:
parent
48d328b144
commit
3d8b0036d1
|
@ -655,6 +655,18 @@ class Application(object):
|
||||||
f = getattr(self.window(), methodname)
|
f = getattr(self.window(), methodname)
|
||||||
f()
|
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
|
# load user configuration NOW
|
||||||
def loadrc(self):
|
def loadrc(self):
|
||||||
path = os.path.join(os.getenv('HOME'), '.pmc', 'conf')
|
path = os.path.join(os.getenv('HOME'), '.pmc', 'conf')
|
||||||
|
|
Loading…
Reference in New Issue