diff --git a/lib/sugar/activity/activity.py b/lib/sugar/activity/activity.py index 14cadd76..55000f3b 100644 --- a/lib/sugar/activity/activity.py +++ b/lib/sugar/activity/activity.py @@ -683,7 +683,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(), 'tmp', + file_path = os.path.join(self.get_activity_root(), 'data', '%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 39ebebc4..cd75edd2 100644 --- a/lib/sugar/activity/activityfactory.py +++ b/lib/sugar/activity/activityfactory.py @@ -79,7 +79,16 @@ def get_environment(activity): environ = os.environ.copy() bin_path = os.path.join(activity.path, 'bin') + activity_root = env.get_profile_path(activity.bundle_id) + if not os.path.exists(activity_root): + os.mkdir(activity_root) + + data_dir = os.path.join(activity_root, 'data') + os.mkdir(data_dir) + + tmp_dir = os.path.join(activity_root, 'tmp') + os.mkdir(tmp_dir) environ['SUGAR_BUNDLE_PATH'] = activity.path environ['SUGAR_ACTIVITY_ROOT'] = activity_root