From dae3ebe8d1733d54ad8d46ead7db97615ed7e4d0 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 7 Nov 2007 12:13:17 +0100 Subject: [PATCH] Create an instance dir and write journal files into it. --- lib/sugar/activity/activity.py | 2 +- lib/sugar/activity/activityfactory.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/sugar/activity/activity.py b/lib/sugar/activity/activity.py index 7c095c5a..71e53452 100644 --- a/lib/sugar/activity/activity.py +++ b/lib/sugar/activity/activity.py @@ -689,7 +689,7 @@ class Activity(Window, gtk.Container): if self._jobject.file_path: self.write_file(self._jobject.file_path) else: - file_path = os.path.join(self.get_activity_root(), 'data', + file_path = os.path.join(self.get_activity_root(), 'instance', '%i' % time.time()) self.write_file(file_path) self._owns_file = True diff --git a/lib/sugar/activity/activityfactory.py b/lib/sugar/activity/activityfactory.py index 46b86891..8e49e948 100644 --- a/lib/sugar/activity/activityfactory.py +++ b/lib/sugar/activity/activityfactory.py @@ -82,6 +82,10 @@ def get_environment(activity): if not os.path.exists(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') if not os.path.exists(data_dir): os.mkdir(data_dir)