Changes

Jump to navigation Jump to search
→‎Files: added get_activity_root snippet
Line 75: Line 75:  
  from sugar.activity import activity
 
  from sugar.activity import activity
 
  bundle_path = activity.get_bundle_path()
 
  bundle_path = activity.get_bundle_path()
 +
 +
This snippet shows how to get [http://lists.laptop.org/pipermail/devel/2008-March/011799.html a path to an activity's writable directories] (i.e. the SUGAR_ACTIVITY_ROOT environment variable; see also [[Activity_DBus_API#Security | the activity DBus API]]):
 +
 +
class WebActivity(activity.Activity):
 +
    def __init__(self, handle):
 +
        activity.Activity.__init__(self, handle)
 +
        temp_path = os.path.join(self.get_activity_root(), 'instance')
    
== Images ==
 
== Images ==
5

edits

Navigation menu