Ticket #3142: 0001-Use-json-as-included-in-Python-SL-3142.patch

File 0001-Use-json-as-included-in-Python-SL-3142.patch, 1.4 KB (added by humitos, 9 years ago)
  • src/sugar/activity/activity.py

    From ca1c4f00422572bb44e7c25d060b4186f3351978 Mon Sep 17 00:00:00 2001
    From: Manuel Kaufmann <humitos@gmail.com>
    Date: Wed, 8 Aug 2012 11:20:29 -0300
    Subject: [PATCH sugar-toolkit] Use json as included in Python SL #3142
    
    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.
    
    Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
    ---
     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..1e3aa33 100644
    a b import gobject 
    6161import dbus
    6262import dbus.service
    6363from dbus import PROPERTIES_IFACE
    64 import cjson
     64import json
    6565from telepathy.server import DBusProperties
    6666from telepathy.interfaces import CHANNEL, \
    6767                                 CHANNEL_TYPE_TEXT, \
    class Activity(Window, gtk.Container): 
    677677
    678678        buddies_dict = self._get_buddies()
    679679        if buddies_dict:
    680             self.metadata['buddies_id'] = cjson.encode(buddies_dict.keys())
    681             self.metadata['buddies'] = cjson.encode(self._get_buddies())
     680            self.metadata['buddies_id'] = json.dumps(buddies_dict.keys())
     681            self.metadata['buddies'] = json.dumps(self._get_buddies())
    682682
    683683        preview = self.get_preview()
    684684        if preview is not None: