Changes

Jump to navigation Jump to search
FIELD_OTHER
Line 38: Line 38:  
FIELD_MESSAGE_boboget
 
FIELD_MESSAGE_boboget
   −
== Files ==
+
FIELD_MESSAGE_sitalc
 
  −
This snippet shows how to get a [http://mailman.laptop.org/pipermail/sugar/2007-February/001459.html path to files in the running Activity]:
  −
 
  −
from sugar.activity import activity
  −
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 ==
Anonymous user

Navigation menu