Permalink
Browse files

Added compiled docs to the repo. Better documented public methods. Ch…

…anged search api back to accepting a query string as the first param and either kwargs or the second parameter to define options. Fixed tests.
  • Loading branch information...
sudorandom committed Apr 4, 2012
1 parent 50bfaac commit d237ba7b14a8135171bb57a7da192eef7d99e174
Showing with 10,097 additions and 90 deletions.
  1. +0 −1 .gitignore
  2. +4 −4 README.markdown
  3. BIN docs/build/doctrees/client.doctree
  4. BIN docs/build/doctrees/container.doctree
  5. BIN docs/build/doctrees/environment.pickle
  6. BIN docs/build/doctrees/index.doctree
  7. BIN docs/build/doctrees/license.doctree
  8. BIN docs/build/doctrees/object.doctree
  9. +4 −0 docs/build/html/.buildinfo
  10. +92 −0 docs/build/html/_modules/index.html
  11. +145 −0 docs/build/html/_modules/object_storage.html
  12. +460 −0 docs/build/html/_modules/object_storage/client.html
  13. +410 −0 docs/build/html/_modules/object_storage/container.html
  14. +509 −0 docs/build/html/_modules/object_storage/storage_object.html
  15. +14 −0 docs/build/html/_sources/client.txt
  16. +9 −0 docs/build/html/_sources/container.txt
  17. +31 −0 docs/build/html/_sources/index.txt
  18. +34 −0 docs/build/html/_sources/license.txt
  19. +9 −0 docs/build/html/_sources/object.txt
  20. +509 −0 docs/build/html/_static/basic.css
  21. +255 −0 docs/build/html/_static/default.css
  22. +247 −0 docs/build/html/_static/doctools.js
  23. BIN docs/build/html/_static/file.png
  24. +4,376 −0 docs/build/html/_static/jquery.js
  25. BIN docs/build/html/_static/minus.png
  26. BIN docs/build/html/_static/plus.png
  27. +61 −0 docs/build/html/_static/pygments.css
  28. +518 −0 docs/build/html/_static/searchtools.js
  29. +147 −0 docs/build/html/_static/sidebar.js
  30. +16 −0 docs/build/html/_static/underscore.js
  31. +381 −0 docs/build/html/client.html
  32. +338 −0 docs/build/html/container.html
  33. +348 −0 docs/build/html/genindex.html
  34. +133 −0 docs/build/html/index.html
  35. +118 −0 docs/build/html/license.html
  36. +359 −0 docs/build/html/object.html
  37. BIN docs/build/html/objects.inv
  38. +111 −0 docs/build/html/py-modindex.html
  39. +102 −0 docs/build/html/search.html
  40. +1 −0 docs/build/html/searchindex.js
  41. +5 −5 docs/source/object.rst
  42. +16 −2 object_storage/__init__.py
  43. +123 −33 object_storage/client.py
  44. +88 −8 object_storage/container.py
  45. +116 −27 object_storage/storage_object.py
  46. +6 −6 tests/integration/httplib.py
  47. +0 −1 tests/unit/authentication.py
  48. +2 −3 tests/unit/container.py
View
@@ -1,6 +1,5 @@
*.swp
*.pyc
-build
dist
*.log
*.egg-info
View
@@ -58,16 +58,16 @@ sl_storage['foo'].delete()
Search Usage
------------
```python
-sl_storage.search({'q': 'foo'})
+sl_storage.search('foo')
# {'count': 2, 'total': 2, 'results': [Container(foo), StorageObject(bar, foo)]}
-sl_storage['foo'].search({'q': 'bar.txt'})
+sl_storage['foo'].search('bar.txt')
# {'count': 1, 'total': 1, 'results': [StorageObject(foo, bar.txt)]}
-sl_storage.search({'q': 'foo', 'type': 'container'})
+sl_storage.search('foo', type='container')
# {'count': 1, 'total': 1, 'results': [Container(foo)]}
-sl_storage.search({'q': 'foo*baz'})
+sl_storage.search('foo*baz')
# {'count': 1, 'total': 1, 'results': [Container(foobarbaz)]}
```
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
+# Sphinx build info version 1
+# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
+config:
+tags:
@@ -0,0 +1,92 @@
+
+
+<!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>Overview: module code &mdash; SoftLayer Object Storage v0.4 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: '0.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="SoftLayer Object Storage v0.4 documentation" href="../index.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><a href="../index.html">SoftLayer Object Storage v0.4 documentation</a> &raquo;</li>
+ </ul>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body">
+
+ <h1>All modules for which code is available</h1>
+<ul><li><a href="object_storage.html">object_storage</a></li>
+<ul><li><a href="object_storage/client.html">object_storage.client</a></li>
+<li><a href="object_storage/container.html">object_storage.container</a></li>
+<li><a href="object_storage/storage_object.html">object_storage.storage_object</a></li>
+</ul></ul>
+
+ </div>
+ </div>
+ </div>
+ <div class="sphinxsidebar">
+ <div class="sphinxsidebarwrapper">
+<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><a href="../index.html">SoftLayer Object Storage v0.4 documentation</a> &raquo;</li>
+ </ul>
+ </div>
+ <div class="footer">
+ &copy; Copyright 2012 SoftLayer Technologies, Inc..
+ Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
+ </div>
+ </body>
+</html>
@@ -0,0 +1,145 @@
+
+
+<!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>object_storage &mdash; SoftLayer Object Storage v0.4 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: '0.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="SoftLayer Object Storage v0.4 documentation" href="../index.html" />
+ <link rel="up" title="Module code" href="index.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><a href="../index.html">SoftLayer Object Storage v0.4 documentation</a> &raquo;</li>
+ <li><a href="index.html" accesskey="U">Module code</a> &raquo;</li>
+ </ul>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body">
+
+ <h1>Source code for object_storage</h1><div class="highlight"><pre>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="sd"> SoftLayer Object Storage python client.</span>
+<span class="sd"> </span>
+<span class="sd"> See COPYING for license information</span>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="kn">from</span> <span class="nn">object_storage.client</span> <span class="kn">import</span> <span class="n">Client</span>
+<span class="kn">from</span> <span class="nn">object_storage.consts</span> <span class="kn">import</span> <span class="n">__version__</span>
+
+<div class="viewcode-block" id="get_client"><a class="viewcode-back" href="../client.html#object_storage.get_client">[docs]</a><span class="k">def</span> <span class="nf">get_client</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot; Returns an Object Storage client (using httplib2)</span>
+
+<span class="sd"> @param username: username for Object Storage</span>
+<span class="sd"> @param password: password or api key for Object Storage</span>
+<span class="sd"> @param auth_url: Auth URL for Object Storage</span>
+<span class="sd"> @param auth_token: If provided, bypasses authentication and uses the given auth_token</span>
+<span class="sd"> @return: `object_storage.client.Client` </span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">return</span> <span class="n">get_httplib2_client</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="get_httplib2_client"><a class="viewcode-back" href="../client.html#object_storage.get_httplib2_client">[docs]</a><span class="k">def</span> <span class="nf">get_httplib2_client</span><span class="p">(</span><span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span> <span class="n">auth_url</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">auth_token</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot; Returns an Object Storage client (using httplib2)</span>
+
+<span class="sd"> @param username: username for Object Storage</span>
+<span class="sd"> @param password: password or api key for Object Storage</span>
+<span class="sd"> @param auth_url: Auth URL for Object Storage</span>
+<span class="sd"> @param auth_token: If provided, bypasses authentication and uses the given auth_token</span>
+<span class="sd"> @return: `object_storage.client.Client` </span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="kn">from</span> <span class="nn">object_storage.transport.httplib2conn</span> <span class="kn">import</span> <span class="n">AuthenticatedConnection</span><span class="p">,</span> <span class="n">Authentication</span>
+
+ <span class="n">auth</span> <span class="o">=</span> <span class="n">Authentication</span><span class="p">(</span><span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span> <span class="n">auth_url</span><span class="o">=</span><span class="n">auth_url</span><span class="p">,</span> <span class="n">auth_token</span><span class="o">=</span><span class="n">auth_token</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+ <span class="n">conn</span> <span class="o">=</span> <span class="n">AuthenticatedConnection</span><span class="p">(</span><span class="n">auth</span><span class="p">)</span>
+ <span class="n">client</span> <span class="o">=</span> <span class="n">Client</span><span class="p">(</span><span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span> <span class="n">connection</span><span class="o">=</span><span class="n">conn</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">client</span>
+</div>
+<div class="viewcode-block" id="get_requests_client"><a class="viewcode-back" href="../client.html#object_storage.get_requests_client">[docs]</a><span class="k">def</span> <span class="nf">get_requests_client</span><span class="p">(</span><span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span> <span class="n">auth_url</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">auth_token</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot; Returns an Object Storage client (using Requests) &quot;&quot;&quot;</span>
+ <span class="kn">from</span> <span class="nn">object_storage.transport.requestsconn</span> <span class="kn">import</span> <span class="n">AuthenticatedConnection</span><span class="p">,</span> <span class="n">Authentication</span>
+
+ <span class="n">auth</span> <span class="o">=</span> <span class="n">Authentication</span><span class="p">(</span><span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span> <span class="n">auth_url</span><span class="o">=</span><span class="n">auth_url</span><span class="p">,</span> <span class="n">auth_token</span><span class="o">=</span><span class="n">auth_token</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+ <span class="n">conn</span> <span class="o">=</span> <span class="n">AuthenticatedConnection</span><span class="p">(</span><span class="n">auth</span><span class="p">)</span>
+ <span class="n">client</span> <span class="o">=</span> <span class="n">Client</span><span class="p">(</span><span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span> <span class="n">connection</span><span class="o">=</span><span class="n">conn</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">client</span>
+</div>
+<div class="viewcode-block" id="get_twisted_client"><a class="viewcode-back" href="../client.html#object_storage.get_twisted_client">[docs]</a><span class="k">def</span> <span class="nf">get_twisted_client</span><span class="p">(</span><span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span> <span class="n">auth_url</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">auth_token</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot; Returns an Object Storage client (using Twisted) &quot;&quot;&quot;</span>
+ <span class="kn">from</span> <span class="nn">object_storage.transport.twist</span> <span class="kn">import</span> <span class="n">AuthenticatedConnection</span><span class="p">,</span> <span class="n">Authentication</span>
+
+ <span class="n">auth</span> <span class="o">=</span> <span class="n">Authentication</span><span class="p">(</span><span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span> <span class="n">auth_url</span><span class="o">=</span><span class="n">auth_url</span><span class="p">,</span> <span class="n">auth_token</span><span class="o">=</span><span class="n">auth_token</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+ <span class="n">conn</span> <span class="o">=</span> <span class="n">AuthenticatedConnection</span><span class="p">(</span><span class="n">auth</span><span class="p">)</span>
+ <span class="n">client</span> <span class="o">=</span> <span class="n">Client</span><span class="p">(</span><span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span> <span class="n">connection</span><span class="o">=</span><span class="n">conn</span><span class="p">)</span>
+
+ <span class="n">d</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">authenticate</span><span class="p">()</span><span class="o">.</span><span class="n">addCallback</span><span class="p">(</span><span class="k">lambda</span> <span class="n">r</span><span class="p">:</span> <span class="n">client</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">d</span></div>
+</pre></div>
+
+ </div>
+ </div>
+ </div>
+ <div class="sphinxsidebar">
+ <div class="sphinxsidebarwrapper">
+<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><a href="../index.html">SoftLayer Object Storage v0.4 documentation</a> &raquo;</li>
+ <li><a href="index.html" >Module code</a> &raquo;</li>
+ </ul>
+ </div>
+ <div class="footer">
+ &copy; Copyright 2012 SoftLayer Technologies, Inc..
+ Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
+ </div>
+ </body>
+</html>
Oops, something went wrong.

0 comments on commit d237ba7

Please sign in to comment.