fixed another bug in the installation procedure (~/.gaphor can not be created from within the easyinstall process)
git-svn-id: file:///Users/arjan/backup/gaphor/gaphor/trunk@1205 a8418922-720d-0410-834f-a69b97ada669
This commit is contained in:
parent
65d8c5c389
commit
fc48ea6efb
@ -104,8 +104,8 @@ class FileBackend(object):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def get_filename(self, datadir):
|
||||
if not os.path.exists(datadir):
|
||||
def get_filename(self, datadir, create=False):
|
||||
if create and not os.path.exists(datadir):
|
||||
os.mkdir(datadir)
|
||||
return os.path.join(datadir, self.RESOURCE_FILE)
|
||||
|
||||
@ -123,7 +123,7 @@ class FileBackend(object):
|
||||
@resource is the Resource instance
|
||||
@persistent is a list of persistent resource names.
|
||||
"""
|
||||
filename = self.get_filename(resource('UserDataDir'))
|
||||
filename = self.get_filename(resource('UserDataDir'), create=True)
|
||||
f = open(filename, 'w')
|
||||
persist = dict([(k, v) for k, v in resource._items() if k in persistent])
|
||||
pprint.pprint(persist, f)
|
||||
|
Loading…
x
Reference in New Issue
Block a user