Manuel Kaufmann <humi...@gmail.com> writes:

[logcollect.py]
> @@ -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 [1], so until we provide a better
way it should be safe (albeit a bit hacky) to use
jarabe.config.activities_path.


>              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.

Sascha

[1] 
https://git.sugarlabs.org/sugar/mainline/commit/d0cd8e27bdd3ef6745f2ec1ff02cc191ffbd2af8
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/

Attachment: pgpK8ummznD1o.pgp
Description: PGP signature

_______________________________________________
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel

Reply via email to