diff options
author | Walter Bender <walter@walter-laptop.(none)> | 2009-09-08 13:46:42 (GMT) |
---|---|---|
committer | Walter Bender <walter@walter-laptop.(none)> | 2009-09-08 13:46:42 (GMT) |
commit | 5a1e4f982f74299e650cd551781c6d928458ced9 (patch) | |
tree | e5f075de2d37d617a910f399367ca168de4a8ba9 | |
parent | 0cdc5698cda69153a72aacdc39413ae239344493 (diff) |
using activity.get_activity_root()
-rwxr-xr-x | measure.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -46,8 +46,15 @@ class MeasureActivity(activity.Activity): def __init__(self, handle): activity.Activity.__init__(self, handle) - act_root = environ['SUGAR_ACTIVITY_ROOT'] - tmp_dir = join(act_root, 'data') + + try: + tmp_dir = os.path.join(activity.get_activity_root(), "data") + except: + # Early versions of Sugar (e.g., 656) didn't support + # get_activity_root() + tmp_dir = os.path.join( \ + os.environ['HOME'], \ + ".sugar/default/org.laptop.MeasureActivity/data") self.active_status = True self.ACTIVE = True |