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

Save DS files in data (since tmp will be on tmpfs in rainbow)
master
Marco Pesenti Gritti 17 years ago
parent ca3c990dc1
commit 5732433d3e

@ -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

@ -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

Loading…
Cancel
Save