[Sugar-devel] [PATCH] Use json as included in Python SL #3142

Manuel Quiñones manuq at laptop.org
Wed Aug 8 09:49:03 EDT 2012


Great,

2012/8/8 Simon Schampijer <simon at schampijer.de>:
> We use json as included in Python. This will make Sugar dependent on
> Python 2.6 and Python 2.7 to have the highest JSON performance. The
> same patch landed in toolkit-gtk3 already.
>
> Signed-off-by: Simon Schampijer <simon at laptop.org>

Acked-by: Manuel Quiñones <manuq at laptop.org>

> ---
>  src/sugar/activity/activity.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/sugar/activity/activity.py b/src/sugar/activity/activity.py
> index bfc7358..2cf347e 100644
> --- a/src/sugar/activity/activity.py
> +++ b/src/sugar/activity/activity.py
> @@ -54,6 +54,7 @@ import os
>  import time
>  from hashlib import sha1
>  from functools import partial
> +import json
>
>  import gconf
>  import gtk
> @@ -61,7 +62,6 @@ import gobject
>  import dbus
>  import dbus.service
>  from dbus import PROPERTIES_IFACE
> -import cjson
>  from telepathy.server import DBusProperties
>  from telepathy.interfaces import CHANNEL, \
>                                   CHANNEL_TYPE_TEXT, \
> @@ -677,8 +677,8 @@ class Activity(Window, gtk.Container):
>
>          buddies_dict = self._get_buddies()
>          if buddies_dict:
> -            self.metadata['buddies_id'] = cjson.encode(buddies_dict.keys())
> -            self.metadata['buddies'] = cjson.encode(self._get_buddies())
> +            self.metadata['buddies_id'] = json.dumps(buddies_dict.keys())
> +            self.metadata['buddies'] = json.dumps(self._get_buddies())
>
>          preview = self.get_preview()
>          if preview is not None:
> --
> 1.7.11.2
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel



-- 
.. manuq ..


More information about the Sugar-devel mailing list