diff --git a/keyboard.py b/keyboard.py
index 34a9da2..9a04d9d 100644
a
|
b
|
import gtk |
22 | 22 | import rsvg |
23 | 23 | import os, glob, re |
24 | 24 | import pango |
25 | | import simplejson |
| 25 | import json |
26 | 26 | |
27 | 27 | # Tweaking variables. |
28 | 28 | HAND_YOFFSET = -15 |
… |
… |
class KeyboardData: |
321 | 321 | pass |
322 | 322 | |
323 | 323 | def load_letter_map(self, filename): |
324 | | self.letter_map = simplejson.loads(open(filename, 'r').read()) |
| 324 | self.letter_map = json.loads(open(filename, 'r').read()) |
325 | 325 | |
326 | 326 | def save_letter_map(self, filename): |
327 | | text = simplejson.dumps(self.letter_map, ensure_ascii=False, sort_keys=True, indent=4) |
| 327 | text = json.dumps(self.letter_map, ensure_ascii=False, sort_keys=True, indent=4) |
328 | 328 | f = open(filename, 'w') |
329 | 329 | f.write(text) |
330 | 330 | f.close() |
diff --git a/lessonbuilder.py b/lessonbuilder.py
index fa942b7..396ac86 100755
a
|
b
|
|
16 | 16 | # You should have received a copy of the GNU General Public License |
17 | 17 | # along with Typing Turtle. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 | |
19 | | import os, sys, random, simplejson, locale, re, optparse |
| 19 | import os, sys, random, json, locale, re, optparse |
20 | 20 | from gettext import gettext as _ |
21 | 21 | |
22 | 22 | # For modifier constants. |
… |
… |
def main(): |
561 | 561 | new_keys=options.keys, base_keys=options.base_keys, |
562 | 562 | words=words, bad_words=bad_words) |
563 | 563 | |
564 | | text = simplejson.dumps(lesson, ensure_ascii=False, sort_keys=True, indent=4) |
| 564 | text = json.dumps(lesson, ensure_ascii=False, sort_keys=True, indent=4) |
565 | 565 | |
566 | 566 | open(options.output, 'w').write(text) |
567 | 567 | |
diff --git a/lessonscreen.py b/lessonscreen.py
index 5b620cb..3177dd5 100644
a
|
b
|
|
16 | 16 | # vi:sw=4 et |
17 | 17 | |
18 | 18 | # Import standard Python modules. |
19 | | import logging, os, math, time, copy, json, locale, datetime, random, re |
| 19 | import logging, os, math, time, copy, locale, datetime, random, re |
20 | 20 | from gettext import gettext as _ |
21 | 21 | |
22 | 22 | # Import PyGTK. |
diff --git a/mainscreen.py b/mainscreen.py
index 56c105e..8af4f93 100644
a
|
b
|
|
15 | 15 | # along with Typing Turtle. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | |
17 | 17 | # Import standard Python modules. |
18 | | import logging, os, math, time, copy, simplejson, locale, datetime, random, re, glob |
| 18 | import logging, os, math, time, copy, cjson, locale, datetime, random, re, glob |
19 | 19 | from gettext import gettext as _ |
20 | 20 | |
21 | 21 | # Import PyGTK. |
… |
… |
class MainScreen(gtk.VBox): |
126 | 126 | for f in glob.iglob(path + '/*.lesson'): |
127 | 127 | fd = open(f, 'r') |
128 | 128 | try: |
129 | | lesson = simplejson.loads(fd.read()) |
| 129 | lesson = cjson.decode(fd.read()) |
130 | 130 | self.lessons.append(lesson) |
131 | 131 | finally: |
132 | 132 | fd.close() |
diff --git a/medalscreen.py b/medalscreen.py
index 42833bf..a1d881a 100644
a
|
b
|
|
15 | 15 | # along with Typing Turtle. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | |
17 | 17 | # Import standard Python modules. |
18 | | import logging, os, math, time, copy, json, locale, datetime, random, re |
| 18 | import logging, os, math, time, copy, locale, datetime, random, re |
19 | 19 | from gettext import gettext as _ |
20 | 20 | |
21 | 21 | # Import PyGTK. |
diff --git a/typingturtle.py b/typingturtle.py
index e9c2f9e..e09fc71 100755
a
|
b
|
class TypingTurtle(sugar.activity.activity.Activity): |
115 | 115 | try: |
116 | 116 | text = fd.read() |
117 | 117 | print "read %s" % text |
118 | | self.data = json.read(text) |
| 118 | self.data = json.loads(text) |
119 | 119 | finally: |
120 | 120 | fd.close() |
121 | 121 | |
… |
… |
class TypingTurtle(sugar.activity.activity.Activity): |
129 | 129 | |
130 | 130 | fd = open(file_path, 'w') |
131 | 131 | try: |
132 | | text = json.write(self.data) |
| 132 | text = json.dumps(self.data) |
133 | 133 | fd.write(text) |
134 | 134 | print "wrote %s" % text |
135 | 135 | finally: |