e88cd377 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsonrpc.jsonutil — JSONRPC v1.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '1.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="JSONRPC v1.0 documentation" href="index.html" />
<link rel="prev" title="JSON-RPC Proxy" href="proxy.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="proxy.html" title="JSON-RPC Proxy"
accesskey="P">previous</a> |</li>
<li><a href="index.html">JSONRPC v1.0 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="module-jsonrpc.jsonutil">
<span id="jsonrpc-jsonutil"></span><h1>jsonrpc.jsonutil<a class="headerlink" href="#module-jsonrpc.jsonutil" title="Permalink to this headline">¶</a></h1>
<p>This module is primarily a wrapper around simplejson in order to make
it behave like demjson</p>
<ul>
<li><dl class="first docutils">
<dt>If an object being encoded has a ‘json_equivalent’ attribute, that will be called to get a (more)</dt>
<dd><p class="first last">serializable object</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>if it has an ‘items’ method, it will be called</dt>
<dd><ul class="first last simple">
<li>if it defines both items and iteritems, the second will be used)</li>
</ul>
</dd>
</dl>
</li>
<li><p class="first">if it is iterable, it will be made into a list</p>
</li>
<li><p class="first">otherwise ‘str’ will be called on the object, and that result will be used</p>
</li>
</ul>
<dl class="function">
<dt id="jsonrpc.jsonutil.encode">
<tt class="descclassname">jsonrpc.jsonutil.</tt><tt class="descname">encode</tt><big>(</big><em>obj</em>, <em>skipkeys=False</em>, <em>ensure_ascii=True</em>, <em>check_circular=True</em>, <em>allow_nan=True</em>, <em>cls=None</em>, <em>indent=None</em>, <em>separators=None</em>, <em>encoding='utf-8'</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#jsonrpc.jsonutil.encode" title="Permalink to this definition">¶</a></dt>
<dd><p>Serialize obj to json, if it is not of a type which the encoder can handle,
make it the proper type. Args and kw are as in json.dumps</p>
</dd></dl>
<dl class="function">
<dt id="jsonrpc.jsonutil.decode">
<tt class="descclassname">jsonrpc.jsonutil.</tt><tt class="descname">decode</tt><big>(</big><em>str</em>, <em>encoding=None</em>, <em>cls=None</em>, <em>object_hook=None</em>, <em>parse_float=None</em>, <em>parse_int=None</em>, <em>parse_constant=None</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#jsonrpc.jsonutil.decode" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an object from a json string. This is just <a class="reference external" href="http://docs.python.org/2.7/library/json.html#json.loads" title="(in Python v2.7)"><tt class="xref py py-func docutils literal"><span class="pre">json.loads()</span></tt></a> renamed</p>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="proxy.html"
title="previous chapter">JSON-RPC Proxy</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/jsonutil.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="proxy.html" title="JSON-RPC Proxy"
>previous</a> |</li>
<li><a href="index.html">JSONRPC v1.0 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2011, Edward Langley.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
</div>
</body>
</html>
|