/src/pyechonest/doc/build/html/util.html
http://echo-nest-remix.googlecode.com/ · HTML · 198 lines · 177 code · 21 blank · 0 comment · 0 complexity · 5bef299b97e7937778e8e4fb9bfb8941 MD5 · raw file
- <!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>Util utility functions — pyechonest v4 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: '4',
- 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="pyechonest v4 documentation" href="index.html" />
- <link rel="next" title="Config configuration file" href="config.html" />
- <link rel="prev" title="Catalog catalog methods" href="catalog.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="config.html" title="Config configuration file"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="catalog.html" title="Catalog catalog methods"
- accesskey="P">previous</a> |</li>
- <li><a href="index.html">pyechonest v4 documentation</a> »</li>
- </ul>
- </div>
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body">
-
- <div class="section" id="module-pyechonest.util">
- <span id="util-utility-functions"></span><h1>Util – utility functions<a class="headerlink" href="#module-pyechonest.util" title="Permalink to this headline">ś</a></h1>
- <p>Copyright (c) 2010 The Echo Nest. All rights reserved.
- Created by Tyler Williams on 2010-04-25.</p>
- <p>Utility functions to support the Echo Nest web API interface.</p>
- <dl class="exception">
- <dt id="pyechonest.util.EchoNestAPIError">
- <em class="property">exception </em><tt class="descclassname">pyechonest.util.</tt><tt class="descname">EchoNestAPIError</tt><big>(</big><em>code</em>, <em>message</em><big>)</big><a class="headerlink" href="#pyechonest.util.EchoNestAPIError" title="Permalink to this definition">ś</a></dt>
- <dd><p>Generic API errors.</p>
- <dl class="method">
- <dt id="pyechonest.util.EchoNestAPIError.__init__">
- <tt class="descname">__init__</tt><big>(</big><em>code</em>, <em>message</em><big>)</big><a class="headerlink" href="#pyechonest.util.EchoNestAPIError.__init__" title="Permalink to this definition">ś</a></dt>
- <dd></dd></dl>
- </dd></dl>
- <dl class="class">
- <dt id="pyechonest.util.MyBaseHandler">
- <em class="property">class </em><tt class="descclassname">pyechonest.util.</tt><tt class="descname">MyBaseHandler</tt><a class="headerlink" href="#pyechonest.util.MyBaseHandler" title="Permalink to this definition">ś</a></dt>
- <dd><dl class="method">
- <dt id="pyechonest.util.MyBaseHandler.default_open">
- <tt class="descname">default_open</tt><big>(</big><em>request</em><big>)</big><a class="headerlink" href="#pyechonest.util.MyBaseHandler.default_open" title="Permalink to this definition">ś</a></dt>
- <dd></dd></dl>
- </dd></dl>
- <dl class="class">
- <dt id="pyechonest.util.MyErrorProcessor">
- <em class="property">class </em><tt class="descclassname">pyechonest.util.</tt><tt class="descname">MyErrorProcessor</tt><a class="headerlink" href="#pyechonest.util.MyErrorProcessor" title="Permalink to this definition">ś</a></dt>
- <dd><dl class="method">
- <dt id="pyechonest.util.MyErrorProcessor.http_response">
- <tt class="descname">http_response</tt><big>(</big><em>request</em>, <em>response</em><big>)</big><a class="headerlink" href="#pyechonest.util.MyErrorProcessor.http_response" title="Permalink to this definition">ś</a></dt>
- <dd></dd></dl>
- </dd></dl>
- <dl class="function">
- <dt id="pyechonest.util.callm">
- <tt class="descclassname">pyechonest.util.</tt><tt class="descname">callm</tt><big>(</big><em>method</em>, <em>param_dict</em>, <em>POST=False</em>, <em>socket_timeout=None</em>, <em>data=None</em><big>)</big><a class="headerlink" href="#pyechonest.util.callm" title="Permalink to this definition">ś</a></dt>
- <dd><p>Call the api!
- Param_dict is a <em>regular</em> <em>python</em> <em>dictionary</em> so if you want to have multi-valued params
- put them in a list.</p>
- <p>** note, if we require 2.6, we can get rid of this timeout munging.</p>
- </dd></dl>
- <dl class="function">
- <dt id="pyechonest.util.codegen">
- <tt class="descclassname">pyechonest.util.</tt><tt class="descname">codegen</tt><big>(</big><em>filename</em>, <em>start=0</em>, <em>duration=30</em><big>)</big><a class="headerlink" href="#pyechonest.util.codegen" title="Permalink to this definition">ś</a></dt>
- <dd></dd></dl>
- <dl class="function">
- <dt id="pyechonest.util.fix">
- <tt class="descclassname">pyechonest.util.</tt><tt class="descname">fix</tt><big>(</big><em>x</em><big>)</big><a class="headerlink" href="#pyechonest.util.fix" title="Permalink to this definition">ś</a></dt>
- <dd></dd></dl>
- <dl class="function">
- <dt id="pyechonest.util.get_successful_response">
- <tt class="descclassname">pyechonest.util.</tt><tt class="descname">get_successful_response</tt><big>(</big><em>raw_json</em><big>)</big><a class="headerlink" href="#pyechonest.util.get_successful_response" title="Permalink to this definition">ś</a></dt>
- <dd></dd></dl>
- <dl class="function">
- <dt id="pyechonest.util.postChunked">
- <tt class="descclassname">pyechonest.util.</tt><tt class="descname">postChunked</tt><big>(</big><em>host</em>, <em>selector</em>, <em>fields</em>, <em>files</em><big>)</big><a class="headerlink" href="#pyechonest.util.postChunked" title="Permalink to this definition">ś</a></dt>
- <dd><p>Attempt to replace postMultipart() with nearly-identical interface.
- (The files tuple no longer requires the filename, and we only return
- the response body.)
- Uses the urllib2_file.py originally from
- <a class="reference external" href="http://fabien.seisen.org">http://fabien.seisen.org</a> which was also drawn heavily from
- <a class="reference external" href="http://code.activestate.com/recipes/146306/">http://code.activestate.com/recipes/146306/</a> .</p>
- <p>This urllib2_file.py is more desirable because of the chunked
- uploading from a file pointer (no need to read entire file into
- memory) and the ability to work from behind a proxy (due to its
- basis on urllib2).</p>
- </dd></dl>
- <dl class="function">
- <dt id="pyechonest.util.reallyUTF8">
- <tt class="descclassname">pyechonest.util.</tt><tt class="descname">reallyUTF8</tt><big>(</big><em>s</em><big>)</big><a class="headerlink" href="#pyechonest.util.reallyUTF8" title="Permalink to this definition">ś</a></dt>
- <dd></dd></dl>
- <dl class="function">
- <dt id="pyechonest.util.reallyunicode">
- <tt class="descclassname">pyechonest.util.</tt><tt class="descname">reallyunicode</tt><big>(</big><em>s</em>, <em>encoding='utf-8'</em><big>)</big><a class="headerlink" href="#pyechonest.util.reallyunicode" title="Permalink to this definition">ś</a></dt>
- <dd></dd></dl>
- </div>
- </div>
- </div>
- </div>
- <div class="sphinxsidebar">
- <div class="sphinxsidebarwrapper">
- <h4>Previous topic</h4>
- <p class="topless"><a href="catalog.html"
- title="previous chapter">Catalog – catalog methods</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="config.html"
- title="next chapter">Config – configuration file</a></p>
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/util.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="config.html" title="Config configuration file"
- >next</a> |</li>
- <li class="right" >
- <a href="catalog.html" title="Catalog catalog methods"
- >previous</a> |</li>
- <li><a href="index.html">pyechonest v4 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer">
- © Copyright 2010, The Echo Nest.
- Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.5.
- </div>
- </body>
- </html>