Create an instance dir and write journal files into it.

This commit is contained in:
Marco Pesenti Gritti 2007-11-07 12:13:17 +01:00
parent 5c60364755
commit dae3ebe8d1
2 changed files with 5 additions and 1 deletions

View File

@ -689,7 +689,7 @@ class Activity(Window, gtk.Container):
if self._jobject.file_path: if self._jobject.file_path:
self.write_file(self._jobject.file_path) self.write_file(self._jobject.file_path)
else: else:
file_path = os.path.join(self.get_activity_root(), 'data', file_path = os.path.join(self.get_activity_root(), 'instance',
'%i' % time.time()) '%i' % time.time())
self.write_file(file_path) self.write_file(file_path)
self._owns_file = True self._owns_file = True

View File

@ -82,6 +82,10 @@ def get_environment(activity):
if not os.path.exists(activity_root): if not os.path.exists(activity_root):
os.mkdir(activity_root) os.mkdir(activity_root)
data_dir = os.path.join(activity_root, 'instance')
if not os.path.exists(data_dir):
os.mkdir(data_dir)
data_dir = os.path.join(activity_root, 'data') data_dir = os.path.join(activity_root, 'data')
if not os.path.exists(data_dir): if not os.path.exists(data_dir):
os.mkdir(data_dir) os.mkdir(data_dir)