[Sugar-devel] [PATCH sugar] Find activities in the xdg system dirs

Gonzalo Odiard gonzalo at laptop.org
Fri Dec 7 08:38:41 EST 2012


Daniel,
Can you explain a little more in your patches, what is the problem you are
trying to solve,
and/or why is the change proposed?
Thanks

Gonzalo

On Fri, Dec 7, 2012 at 10:15 AM, Daniel Narvaez <dwnarvaez at gmail.com> wrote:

> From: Daniel Narvaez <dwnarvaez at gmail.com>
>
> Instead of hardcoding our prefix.
> ---
>  src/jarabe/config.py.in            |    1 -
>  src/jarabe/model/bundleregistry.py |    9 +++++++--
>  2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/src/jarabe/config.py.in b/src/jarabe/config.py.in
> index bfcc2e5..f2a66a2 100644
> --- a/src/jarabe/config.py.in
> +++ b/src/jarabe/config.py.in
> @@ -19,6 +19,5 @@
>  data_path = '@prefix@/share/sugar/data'
>  locale_path = '@prefix@/share/locale'
>  ext_path = '@prefix@/share/sugar/extensions'
> -activities_path = "@prefix@/share/sugar/activities"
>  version = '@SUCROSE_VERSION@'
>
> diff --git a/src/jarabe/model/bundleregistry.py
> b/src/jarabe/model/bundleregistry.py
> index e441122..8a1fa37 100644
> --- a/src/jarabe/model/bundleregistry.py
> +++ b/src/jarabe/model/bundleregistry.py
> @@ -20,6 +20,7 @@ import logging
>
>  from gi.repository import GConf
>  from gi.repository import GObject
> +from gi.repository import GLib
>  from gi.repository import Gio
>  import simplejson
>
> @@ -60,8 +61,12 @@ class BundleRegistry(GObject.GObject):
>          # hold a reference to the monitors so they don't get disposed
>          self._gio_monitors = []
>
> -        user_path = env.get_user_activities_path()
> -        for activity_dir in [user_path, config.activities_path]:
> +        dirs = [env.get_user_activities_path()]
> +
> +        for data_dir in GLib.get_system_data_dirs():
> +            dirs.append(os.path.join(data_dir, "sugar", "activities"))
> +
> +        for activity_dir in dirs:
>              self._scan_directory(activity_dir)
>              directory = Gio.File.new_for_path(activity_dir)
>              monitor = directory.monitor_directory( \
> --
> 1.7.10.4
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20121207/65d5554a/attachment.html>


More information about the Sugar-devel mailing list