[Sugar-devel] [PATCH Log 2/2] Log collector adds user's logs and list installed activities

Sascha Silbe silbe at activitycentral.com
Sun May 13 07:51:37 EDT 2012


Manuel Kaufmann <humitos at 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/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120513/50540baa/attachment.pgp>


More information about the Sugar-devel mailing list