Commits

Anonymous committed 00dbc2c Merge

up 0.10x branch

  • Participants
  • Parent commits b67d5a3, ff4e386
  • Branches 0.10x

Comments (0)

Files changed (3)

 f9fa696b672130cf15a2d16d97c0cc862507d1fc 0.1.9
 c28f80517104b7a4dc402974959449ccfa60ab08 0.1.9.1
 67dddbdb8ae5d668662f2dcbcc7bf484adf50533 0.2
+ffa06885b498666efe9c069a53f640751a38d4e5 0.2.1

File couchdbkit/loaders.py

 import socket
 import sys
 
+import anyjson
+
 from couchdbkit.exceptions import DocsPathNotFound
 from couchdbkit.resource import ResourceNotFound
 from couchdbkit.utils import *
 
         from couchdbkit import BaseDocsLoader
         import os
-        import simplejson as json
+        import anyjson
 
         class MyDocsLoader(BaseDocsLoader):
 
                 if not os.path.exists(path):
                     raise DocsPathNotFound
                 with file(path) as f:
-                    source = json.loads(f.read().decode('utf-8'))
+                    source = anyjson.deserialize(f.read().decode('utf-8'))
                 return source
     """
     
                         
                 if name.endswith('.json'):
                     try:
-                        content = json.loads(content)
+                        content = anyjson.deserialize(content)
                     except ValueError:
                         if verbose >= 2:
                             print >>sys.stderr, "Json invalid in %s" % current_path

File couchdbkit/macros.py

 import os
 import re
 import sys
-# python 2.6
-try:
-    import json 
-except ImportError:
-    import simplejson as json
+from hashlib import md5
 
-from hashlib import md5
+import anyjson
 
 from couchdbkit.utils import read_file, read_json, to_bytestring
 
         return f_string
 
     for k, v in included.iteritems():
-        varstrings.append("var %s = %s;" % (k, json.dumps(v)))
+        varstrings.append("var %s = %s;" % (k, anyjson.serialize(v)))
 
     return re_json.sub(rjson2, f_string)