summaryrefslogtreecommitdiff
path: root/simplejson/decoder.py
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2009-02-22 21:44:12 +0000
committerBob Ippolito <bob@redivi.com>2009-02-22 21:44:12 +0000
commitfbcdcec4059c87693cb662c8766324ec4e9727c8 (patch)
tree5f0c5f1513e3c46421155b424027317581c612af /simplejson/decoder.py
parent173ebd91f223afef30aebbc3da58fdafc935c3cc (diff)
downloadsimplejson-fbcdcec4059c87693cb662c8766324ec4e9727c8.tar.gz
fix long lines, make py2.6+ porting a bit easier
git-svn-id: http://simplejson.googlecode.com/svn/trunk@173 a4795897-2c25-0410-b006-0d3caba88fa1
Diffstat (limited to 'simplejson/decoder.py')
-rw-r--r--simplejson/decoder.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/simplejson/decoder.py b/simplejson/decoder.py
index b769ea4..abdc585 100644
--- a/simplejson/decoder.py
+++ b/simplejson/decoder.py
@@ -62,7 +62,8 @@ BACKSLASH = {
DEFAULT_ENCODING = "utf-8"
-def py_scanstring(s, end, encoding=None, strict=True, _b=BACKSLASH, _m=STRINGCHUNK.match):
+def py_scanstring(s, end, encoding=None, strict=True,
+ _b=BACKSLASH, _m=STRINGCHUNK.match):
"""Scan the string s for a JSON string. End is the index of the
character in s after the quote that started the JSON string.
Unescapes all valid JSON string escape sequences and raises ValueError
@@ -145,7 +146,8 @@ scanstring = c_scanstring or py_scanstring
WHITESPACE = re.compile(r'[ \t\n\r]*', FLAGS)
WHITESPACE_STR = ' \t\n\r'
-def JSONObject((s, end), encoding, strict, scan_once, object_hook, _w=WHITESPACE.match, _ws=WHITESPACE_STR):
+def JSONObject((s, end), encoding, strict, scan_once, object_hook,
+ _w=WHITESPACE.match, _ws=WHITESPACE_STR):
pairs = {}
# Use a slice to prevent IndexError from being raised, the following
# check will raise a more specific ValueError if the string is empty
@@ -339,8 +341,8 @@ class JSONDecoder(object):
return obj
def raw_decode(self, s, idx=0):
- """Decode a JSON document from ``s`` (a ``str`` or ``unicode`` beginning
- with a JSON document) and return a 2-tuple of the Python
+ """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
+ beginning with a JSON document) and return a 2-tuple of the Python
representation and the index in ``s`` where the document ended.
This can be used to decode a JSON document from a string that may