[Sugar-devel] [PATCH Log 2/2] Log collector adds user's logs and list installed activities
silbe at activitycentral.com
Sun May 13 07:51:37 EDT 2012
Manuel Kaufmann <humitos at gmail.com> writes:
> @@ -229,10 +229,11 @@ class MachineProperties:
> def installed_activities(self):
> s = ''
> - for path in glob.glob('/usr/share/activities/*.activity'):
> + for path in glob.glob('/usr/share/sugar/activities/*.activity'):
This won't work if Sugar isn't installed in /usr (e.g. when using
sugar-jhbuild). Unfortunately there doesn't seem to be public /
documented API to query for this; the best we have right now is
jarabe.config.activities_path. It's been there ever since we started
supporting system-installed activities , so until we provide a better
way it should be safe (albeit a bit hacky) to use
> s += os.path.basename(path) + '\n'
> - for path in glob.glob('/home/olpc/Activities/*'):
> + home = os.path.expanduser('~')
> + for path in glob.glob(os.path.join(home, 'Activities', '*')):
> s += '~' + os.path.basename(path) + '\n'
Using sugar.env.get_user_activities_path() would be more future-proof,
matching what Sugar itself is doing.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 489 bytes
Desc: not available
More information about the Sugar-devel