diff options
author | flavio <fdanesse@gmail.com> | 2012-08-08 13:42:11 (GMT) |
---|---|---|
committer | flavio <fdanesse@gmail.com> | 2012-08-08 13:42:11 (GMT) |
commit | 917627f0ffab3b01b764f7169ec87c79a811cc54 (patch) | |
tree | ba1977ffe7338d439d2bf7a0b25ff34a78d31640 | |
parent | 24d236b3b0719d9b49486463737ad654aa15e6d9 (diff) |
-cjson +json
-rw-r--r-- | activity.py | 6 | ||||
-rw-r--r-- | face.py | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/activity.py b/activity.py index 2ef0cbe..f632032 100644 --- a/activity.py +++ b/activity.py @@ -26,7 +26,7 @@ from gi.repository import Gdk from gi.repository import Pango import logging -import cjson +import json from sugar3.presence import presenceservice from sugar3.graphics.toolbarbox import ToolbarButton @@ -293,7 +293,7 @@ class SpeakActivity(SharedActivity): % xoOwner.props.nick) def resume_instance(self, file_path): - cfg = cjson.decode(file(file_path, 'r').read()) + cfg = json.loads(file(file_path, 'r').read()) status = self.face.status = face.Status().deserialize(cfg['status']) self.voices.select(status.voice) @@ -315,7 +315,7 @@ class SpeakActivity(SharedActivity): 'history': [unicode(i[0], 'utf-8', 'ignore') \ for i in self.entrycombo.get_model()], } - file(file_path, 'w').write(cjson.encode(cfg)) + file(file_path, 'w').write(json.dumps(cfg)) def share_instance(self, connection, is_initiator): self.chat.messenger = Messenger(connection, is_initiator, self.chat) @@ -22,7 +22,7 @@ # along with Speak.activity. If not, see <http://www.gnu.org/licenses/>. import logging -import cjson +import json from gi.repository import Gtk from gi.repository import Gdk @@ -60,7 +60,7 @@ class Status(): FFTMouth: 2, WaveformMouth: 3} - return cjson.encode({ + return json.dumps({ 'voice': {'language': self.voice.language, 'name': self.voice.name}, 'pitch': self.pitch, @@ -75,7 +75,7 @@ class Status(): 2: FFTMouth, 3: WaveformMouth} - data = cjson.decode(buf) + data = json.loads(buf) self.voice = voice.Voice(data['voice']['language'], data['voice']['name']) self.pitch = data['pitch'] |