Setup the activity root with a tmp and a data dir.

Save DS files in data (since tmp will be on tmpfs in rainbow)
This commit is contained in:
Marco Pesenti Gritti 2007-10-30 23:38:48 +01:00
parent ca3c990dc1
commit 5732433d3e
2 changed files with 10 additions and 1 deletions

View File

@ -683,7 +683,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(), 'tmp', file_path = os.path.join(self.get_activity_root(), 'data',
'%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

@ -79,7 +79,16 @@ def get_environment(activity):
environ = os.environ.copy() environ = os.environ.copy()
bin_path = os.path.join(activity.path, 'bin') bin_path = os.path.join(activity.path, 'bin')
activity_root = env.get_profile_path(activity.bundle_id) 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_BUNDLE_PATH'] = activity.path
environ['SUGAR_ACTIVITY_ROOT'] = activity_root environ['SUGAR_ACTIVITY_ROOT'] = activity_root