PageRenderTime 406ms CodeModel.GetById 181ms app.highlight 13ms RepoModel.GetById 208ms app.codeStats 0ms

/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
  1
  2
  3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  4  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  5
  6<html xmlns="http://www.w3.org/1999/xhtml">
  7  <head>
  8    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  9    
 10    <title>Util – utility functions &mdash; pyechonest v4 documentation</title>
 11    <link rel="stylesheet" href="_static/default.css" type="text/css" />
 12    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
 13    <script type="text/javascript">
 14      var DOCUMENTATION_OPTIONS = {
 15        URL_ROOT:    '',
 16        VERSION:     '4',
 17        COLLAPSE_INDEX: false,
 18        FILE_SUFFIX: '.html',
 19        HAS_SOURCE:  true
 20      };
 21    </script>
 22    <script type="text/javascript" src="_static/jquery.js"></script>
 23    <script type="text/javascript" src="_static/underscore.js"></script>
 24    <script type="text/javascript" src="_static/doctools.js"></script>
 25    <link rel="top" title="pyechonest v4 documentation" href="index.html" />
 26    <link rel="next" title="Config – configuration file" href="config.html" />
 27    <link rel="prev" title="Catalog – catalog methods" href="catalog.html" /> 
 28  </head>
 29  <body>
 30    <div class="related">
 31      <h3>Navigation</h3>
 32      <ul>
 33        <li class="right" style="margin-right: 10px">
 34          <a href="genindex.html" title="General Index"
 35             accesskey="I">index</a></li>
 36        <li class="right" >
 37          <a href="py-modindex.html" title="Python Module Index"
 38             >modules</a> |</li>
 39        <li class="right" >
 40          <a href="config.html" title="Config – configuration file"
 41             accesskey="N">next</a> |</li>
 42        <li class="right" >
 43          <a href="catalog.html" title="Catalog – catalog methods"
 44             accesskey="P">previous</a> |</li>
 45        <li><a href="index.html">pyechonest v4 documentation</a> &raquo;</li> 
 46      </ul>
 47    </div>  
 48
 49    <div class="document">
 50      <div class="documentwrapper">
 51        <div class="bodywrapper">
 52          <div class="body">
 53            
 54  <div class="section" id="module-pyechonest.util">
 55<span id="util-utility-functions"></span><h1>Util &#8211; utility functions<a class="headerlink" href="#module-pyechonest.util" title="Permalink to this headline">ś</a></h1>
 56<p>Copyright (c) 2010 The Echo Nest. All rights reserved.
 57Created by Tyler Williams on 2010-04-25.</p>
 58<p>Utility functions to support the Echo Nest web API interface.</p>
 59<dl class="exception">
 60<dt id="pyechonest.util.EchoNestAPIError">
 61<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>
 62<dd><p>Generic API errors.</p>
 63<dl class="method">
 64<dt id="pyechonest.util.EchoNestAPIError.__init__">
 65<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>
 66<dd></dd></dl>
 67
 68</dd></dl>
 69
 70<dl class="class">
 71<dt id="pyechonest.util.MyBaseHandler">
 72<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>
 73<dd><dl class="method">
 74<dt id="pyechonest.util.MyBaseHandler.default_open">
 75<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>
 76<dd></dd></dl>
 77
 78</dd></dl>
 79
 80<dl class="class">
 81<dt id="pyechonest.util.MyErrorProcessor">
 82<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>
 83<dd><dl class="method">
 84<dt id="pyechonest.util.MyErrorProcessor.http_response">
 85<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>
 86<dd></dd></dl>
 87
 88</dd></dl>
 89
 90<dl class="function">
 91<dt id="pyechonest.util.callm">
 92<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>
 93<dd><p>Call the api! 
 94Param_dict is a <em>regular</em> <em>python</em> <em>dictionary</em> so if you want to have multi-valued params
 95put them in a list.</p>
 96<p>** note, if we require 2.6, we can get rid of this timeout munging.</p>
 97</dd></dl>
 98
 99<dl class="function">
100<dt id="pyechonest.util.codegen">
101<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>
102<dd></dd></dl>
103
104<dl class="function">
105<dt id="pyechonest.util.fix">
106<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>
107<dd></dd></dl>
108
109<dl class="function">
110<dt id="pyechonest.util.get_successful_response">
111<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>
112<dd></dd></dl>
113
114<dl class="function">
115<dt id="pyechonest.util.postChunked">
116<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>
117<dd><p>Attempt to replace postMultipart() with nearly-identical interface.
118(The files tuple no longer requires the filename, and we only return
119the response body.) 
120Uses the urllib2_file.py originally from 
121<a class="reference external" href="http://fabien.seisen.org">http://fabien.seisen.org</a> which was also drawn heavily from 
122<a class="reference external" href="http://code.activestate.com/recipes/146306/">http://code.activestate.com/recipes/146306/</a> .</p>
123<p>This urllib2_file.py is more desirable because of the chunked 
124uploading from a file pointer (no need to read entire file into 
125memory) and the ability to work from behind a proxy (due to its 
126basis on urllib2).</p>
127</dd></dl>
128
129<dl class="function">
130<dt id="pyechonest.util.reallyUTF8">
131<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>
132<dd></dd></dl>
133
134<dl class="function">
135<dt id="pyechonest.util.reallyunicode">
136<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>
137<dd></dd></dl>
138
139</div>
140
141
142          </div>
143        </div>
144      </div>
145      <div class="sphinxsidebar">
146        <div class="sphinxsidebarwrapper">
147  <h4>Previous topic</h4>
148  <p class="topless"><a href="catalog.html"
149                        title="previous chapter">Catalog &#8211; catalog methods</a></p>
150  <h4>Next topic</h4>
151  <p class="topless"><a href="config.html"
152                        title="next chapter">Config &#8211; configuration file</a></p>
153  <h3>This Page</h3>
154  <ul class="this-page-menu">
155    <li><a href="_sources/util.txt"
156           rel="nofollow">Show Source</a></li>
157  </ul>
158<div id="searchbox" style="display: none">
159  <h3>Quick search</h3>
160    <form class="search" action="search.html" method="get">
161      <input type="text" name="q" size="18" />
162      <input type="submit" value="Go" />
163      <input type="hidden" name="check_keywords" value="yes" />
164      <input type="hidden" name="area" value="default" />
165    </form>
166    <p class="searchtip" style="font-size: 90%">
167    Enter search terms or a module, class or function name.
168    </p>
169</div>
170<script type="text/javascript">$('#searchbox').show(0);</script>
171        </div>
172      </div>
173      <div class="clearer"></div>
174    </div>
175    <div class="related">
176      <h3>Navigation</h3>
177      <ul>
178        <li class="right" style="margin-right: 10px">
179          <a href="genindex.html" title="General Index"
180             >index</a></li>
181        <li class="right" >
182          <a href="py-modindex.html" title="Python Module Index"
183             >modules</a> |</li>
184        <li class="right" >
185          <a href="config.html" title="Config – configuration file"
186             >next</a> |</li>
187        <li class="right" >
188          <a href="catalog.html" title="Catalog – catalog methods"
189             >previous</a> |</li>
190        <li><a href="index.html">pyechonest v4 documentation</a> &raquo;</li> 
191      </ul>
192    </div>
193    <div class="footer">
194        &copy; Copyright 2010, The Echo Nest.
195      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.5.
196    </div>
197  </body>
198</html>