Changes
Jump to navigation
Jump to search
Line 38:
Line 38:
− == Files ==+
−
− 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')
Development Team/Almanac/Code Snippets (view source)
Revision as of 20:54, 16 December 2008
, 20:54, 16 December 2008FIELD_OTHER
FIELD_MESSAGE_boboget
FIELD_MESSAGE_boboget
FIELD_MESSAGE_sitalc
== Images ==
== Images ==