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