Revision c41eea6e lib/serializer.py
b/lib/serializer.py | ||
---|---|---|
42 | 42 |
def DumpJson(data, indent=True): |
43 | 43 |
"""Serialize a given object. |
44 | 44 |
|
45 |
Args: |
|
46 |
- indent: Whether to indent output (depends on simplejson version) |
|
45 |
@param data: the data to serialize |
|
46 |
@param indent: whether to indent output (depends on simplejson version) |
|
47 |
|
|
48 |
@return: the string representation of data |
|
47 | 49 |
|
48 | 50 |
""" |
49 | 51 |
if not indent or _JSON_INDENT is None: |
... | ... | |
60 | 62 |
def LoadJson(txt): |
61 | 63 |
"""Unserialize data from a string. |
62 | 64 |
|
65 |
@param txt: the json-encoded form |
|
66 |
|
|
67 |
@return: the original data |
|
68 |
|
|
63 | 69 |
""" |
64 | 70 |
return simplejson.loads(txt) |
65 | 71 |
|
Also available in: Unified diff