Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug 702595 - write initial balrog admin client to support nightly bui…

…ld submissions. r=bhearsum
  • Loading branch information...
commit d3004c243cc96fc24b9ed0ec8f88c893f101178f 1 parent 8971952
@rail rail authored
Showing with 7,356 additions and 1 deletion.
  1. 0  lib/python/balrog/__init__.py
  2. 0  lib/python/balrog/client/__init__.py
  3. +60 −0 lib/python/balrog/client/api.py
  4. +80 −0 lib/python/balrog/client/cli.py
  5. +1 −1  lib/python/release/platforms.py
  6. +417 −0 lib/python/vendor/requests-0.10.8/HISTORY.rst
  7. +13 −0 lib/python/vendor/requests-0.10.8/LICENSE
  8. +1 −0  lib/python/vendor/requests-0.10.8/MANIFEST.in
  9. +25 −0 lib/python/vendor/requests-0.10.8/NOTICE
  10. +515 −0 lib/python/vendor/requests-0.10.8/PKG-INFO
  11. +76 −0 lib/python/vendor/requests-0.10.8/README.rst
  12. +515 −0 lib/python/vendor/requests-0.10.8/requests.egg-info/PKG-INFO
  13. +41 −0 lib/python/vendor/requests-0.10.8/requests.egg-info/SOURCES.txt
  14. +1 −0  lib/python/vendor/requests-0.10.8/requests.egg-info/dependency_links.txt
  15. +2 −0  lib/python/vendor/requests-0.10.8/requests.egg-info/requires.txt
  16. +1 −0  lib/python/vendor/requests-0.10.8/requests.egg-info/top_level.txt
  17. +33 −0 lib/python/vendor/requests-0.10.8/requests/__init__.py
  18. +116 −0 lib/python/vendor/requests-0.10.8/requests/api.py
  19. +106 −0 lib/python/vendor/requests-0.10.8/requests/async.py
  20. +148 −0 lib/python/vendor/requests-0.10.8/requests/auth.py
  21. +105 −0 lib/python/vendor/requests-0.10.8/requests/compat.py
  22. +48 −0 lib/python/vendor/requests-0.10.8/requests/defaults.py
  23. +32 −0 lib/python/vendor/requests-0.10.8/requests/exceptions.py
  24. +48 −0 lib/python/vendor/requests-0.10.8/requests/hooks.py
  25. +816 −0 lib/python/vendor/requests-0.10.8/requests/models.py
  26. +3 −0  lib/python/vendor/requests-0.10.8/requests/packages/__init__.py
  27. +3 −0  lib/python/vendor/requests-0.10.8/requests/packages/oreos/__init__.py
  28. +24 −0 lib/python/vendor/requests-0.10.8/requests/packages/oreos/core.py
  29. +773 −0 lib/python/vendor/requests-0.10.8/requests/packages/oreos/monkeys.py
  30. +399 −0 lib/python/vendor/requests-0.10.8/requests/packages/oreos/structures.py
  31. +48 −0 lib/python/vendor/requests-0.10.8/requests/packages/urllib3/__init__.py
  32. +131 −0 lib/python/vendor/requests-0.10.8/requests/packages/urllib3/_collections.py
  33. +629 −0 lib/python/vendor/requests-0.10.8/requests/packages/urllib3/connectionpool.py
  34. +67 −0 lib/python/vendor/requests-0.10.8/requests/packages/urllib3/exceptions.py
  35. +74 −0 lib/python/vendor/requests-0.10.8/requests/packages/urllib3/filepost.py
  36. +4 −0 lib/python/vendor/requests-0.10.8/requests/packages/urllib3/packages/__init__.py
  37. +47 −0 lib/python/vendor/requests-0.10.8/requests/packages/urllib3/packages/mimetools_choose_boundary/__init__.py
  38. +372 −0 lib/python/vendor/requests-0.10.8/requests/packages/urllib3/packages/six.py
  39. +61 −0 lib/python/vendor/requests-0.10.8/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py
  40. +138 −0 lib/python/vendor/requests-0.10.8/requests/packages/urllib3/poolmanager.py
  41. +147 −0 lib/python/vendor/requests-0.10.8/requests/packages/urllib3/request.py
  42. +191 −0 lib/python/vendor/requests-0.10.8/requests/packages/urllib3/response.py
  43. +300 −0 lib/python/vendor/requests-0.10.8/requests/sessions.py
  44. +86 −0 lib/python/vendor/requests-0.10.8/requests/status_codes.py
  45. +66 −0 lib/python/vendor/requests-0.10.8/requests/structures.py
  46. +463 −0 lib/python/vendor/requests-0.10.8/requests/utils.py
  47. +5 −0 lib/python/vendor/requests-0.10.8/setup.cfg
  48. +67 −0 lib/python/vendor/requests-0.10.8/setup.py
  49. +1 −0  lib/python/vendorlibs.pth
  50. +21 −0 misc/mozilla-root.crt
  51. +36 −0 scripts/updates/balrog-client.py
View
0  lib/python/balrog/__init__.py
No changes.
View
0  lib/python/balrog/client/__init__.py
No changes.
View
60 lib/python/balrog/client/api.py
@@ -0,0 +1,60 @@
+# TODO: extend API to handle release blobs
+
+import logging
+import requests
+import os
+
+CA_BUNDLE = os.path.join(os.path.dirname(__file__),
+ '../../../../misc/mozilla-root.crt')
+
+
+class API(object):
+
+ url_template = \
+ '%(api_root)s/releases/%(name)s/builds/%(build_target)s/%(locale)s'
+
+ verify = False
+ auth = None
+
+ def __init__(self, api_root='https://balrog.build.mozilla.org',
+ auth=None, ca_certs=CA_BUNDLE, timeout=60, raise_exceptions=True):
+ """ Creates an API object which wraps REST API of Balrog server.
+
+ api_root: API root URL of balrog server
+ auth : a tuple of (username, password) or None
+ ca_certs: CA bundle. It follows python-requests `verify' usage.
+ If set to False, no SSL verification is done.
+ If set to True, it tries to load a CA bundle from certifi
+ module.
+ If set to string, puthon-requests uses it as a pth to path to
+ CA bundle.
+ timeout : request timeout
+ raise_exceptions: Sets danger_mode parameter of python-requests config
+ which controls excpetion raising.
+ """
+ self.api_root = api_root.rstrip('/')
+ self.verify = ca_certs
+ assert isinstance(auth, tuple) or auth == None, \
+ "auth should be set to tuple or None"
+ self.auth = auth
+ self.timeout = timeout
+ self.config = dict(danger_mode=raise_exceptions)
+
+ def request(self, url, data=None, method='GET'):
+ logging.debug('Balrog request to %s' % url)
+ logging.debug('Data sent: %s' % data)
+ return requests.request(method=method, url=url, data=data,
+ config=self.config, timeout=self.timeout,
+ verify=self.verify, auth=self.auth)
+
+ def update_build(self, name, product, version, build_target, locale,
+ details, copy_to=None):
+ url_template_vars = dict(api_root=self.api_root, name=name,
+ locale=locale, build_target=build_target)
+ url = self.url_template % url_template_vars
+ data = dict(product=product, version=version,
+ details=details)
+ if copy_to:
+ data['copy_to'] = copy_to
+
+ return self.request(method='PUT', url=url, data=data)
View
80 lib/python/balrog/client/cli.py
@@ -0,0 +1,80 @@
+try:
+ import simplejson as json
+except ImportError:
+ import json
+
+from release.platforms import buildbot2updatePlatforms
+from balrog.client.api import API
+
+
+def get_nightly_blob_name(appName, branch, build_type, suffix, dummy=False):
+ if dummy:
+ branch = '%s-dummy' % branch
+ return '%s-%s-%s-%s' % (appName, branch, build_type, suffix)
+
+
+class NightlyRunner(object):
+
+ build_type = 'nightly'
+ appName = None
+ branch = None
+ build_target = None
+ appVersion = None
+ name = None
+ locale = None
+
+ def __init__(self, buildprops_file, api_root, auth, dummy=False):
+ self.buildbprops_file = buildprops_file
+ self.api_root = api_root
+ self.auth = auth
+ self.dummy = dummy
+
+ def generate_blob(self):
+ fp = open(self.buildbprops_file)
+ bp = json.load(fp)
+ fp.close()
+
+ props = bp['properties']
+ self.build_target = buildbot2updatePlatforms(props['platform'])[0]
+ buildID = props['buildid']
+
+ self.appName = props['appName']
+ self.branch = props['branch']
+ self.appVersion = props['appVersion']
+ self.name = get_nightly_blob_name(self.appName, self.branch,
+ self.build_type, buildID, self.dummy)
+ self.locale = props.get('locale', 'en-US')
+ blob = {
+ 'appv': self.appVersion,
+ 'extv': props.get('extVersion', self.appVersion),
+ 'buildID': props['buildid'],
+ }
+ blob['complete'] = {
+ 'from': '*',
+ 'filesize': props['completeMarSize'],
+ 'hashValue': props['completeMarHash'],
+ 'fileUrl': props['completeMarUrl']
+ }
+ if props.get('partialMarFilename'):
+ blob['partial'] = {
+ 'from': get_nightly_blob_name(self.appName, self.branch,
+ self.build_type,
+ props['previous_buildid'],
+ self.dummy),
+ 'filesize': props['partialMarSize'],
+ 'hashValue': props['partialMarHash'],
+ 'fileUrl': props['partialMarUrl']
+ }
+ return blob
+
+ def run(self):
+ blob = self.generate_blob()
+ blob = json.dumps(blob)
+ api = API(auth=self.auth, api_root=self.api_root)
+ copy_to = [get_nightly_blob_name(
+ self.appName, self.branch, self.build_type, 'latest', self.dummy)]
+ copy_to = repr(copy_to)
+ api.update_build(name=self.name, product=self.appName,
+ build_target=self.build_target,
+ version=self.appVersion, locale=self.locale,
+ details=blob, copy_to=copy_to)
View
2  lib/python/release/platforms.py
@@ -49,7 +49,7 @@ def shippedlocales2buildbot(platform):
return [platform]
def buildbot2updatePlatforms(platform):
- return update_platform_map.get(platform, platform)
+ return update_platform_map.get(platform, [platform])
def getPlatformLocales(shipped_locales, platforms):
platform_locales = {}
View
417 lib/python/vendor/requests-0.10.8/HISTORY.rst
@@ -0,0 +1,417 @@
+History
+-------
+
+0.10.8 (2012-03-09)
++++++++++++++++++++
+
+* Generate chunked ValueError fix
+* Proxy configuration by environment variables
+* Simplification of iter_lines.
+* New `trust_env` configuration for disabling system/environment hints.
+* Suppress cookie errors.
+
+0.10.7 (2012-03-07)
++++++++++++++++++++
+
+* `encode_uri` = False
+
+0.10.6 (2012-02-25)
++++++++++++++++++++
+
+* Allow '=' in cookies.
+
+0.10.5 (2012-02-25)
++++++++++++++++++++
+
+* Response body with 0 content-length fix.
+* New async.imap.
+* Don't fail on netrc.
+
+
+0.10.4 (2012-02-20)
++++++++++++++++++++
+
+* Honor netrc.
+
+0.10.3 (2012-02-20)
++++++++++++++++++++
+
+* HEAD requests don't follow redirects anymore.
+* raise_for_status() doesn't raise for 3xx anymore.
+* Make Session objects picklable.
+* ValueError for invalid schema URLs.
+
+0.10.2 (2012-01-15)
++++++++++++++++++++
+
+* Vastly improved URL quoting.
+* Additional allowed cookie key values.
+* Attempted fix for "Too many open files" Error
+* Replace unicode errors on first pass, no need for second pass.
+* Append '/' to bare-domain urls before query insertion.
+* Exceptions now inherit from RuntimeError.
+* Binary uploads + auth fix.
+* Bugfixes.
+
+
+0.10.1 (2012-01-23)
++++++++++++++++++++
+
+* PYTHON 3 SUPPORT!
+* Dropped 2.5 Support. (*Backwards Incompatible*)
+
+0.10.0 (2012-01-21)
++++++++++++++++++++
+
+* ``Response.content`` is now bytes-only. (*Backwards Incompatible*)
+* New ``Response.text`` is unicode-only.
+* If no ``Response.encoding`` is specified and ``chardet`` is available, ``Respoonse.text`` will guess an encoding.
+* Default to ISO-8859-1 (Western) encoding for "text" subtypes.
+* Removal of `decode_unicode`. (*Backwards Incompatible*)
+* New multiple-hooks system.
+* New ``Response.register_hook`` for registering hooks within the pipeline.
+* ``Response.url`` is now Unicode.
+
+0.9.3 (2012-01-18)
+++++++++++++++++++
+
+* SSL verify=False bugfix (apparent on windows machines).
+
+0.9.2 (2012-01-18)
+++++++++++++++++++
+
+* Asynchronous async.send method.
+* Support for proper chunk streams with boundaries.
+* session argument for Session classes.
+* Print entire hook tracebacks, not just exception instance.
+* Fix response.iter_lines from pending next line.
+* Fix but in HTTP-digest auth w/ URI having query strings.
+* Fix in Event Hooks section.
+* Urllib3 update.
+
+
+0.9.1 (2012-01-06)
+++++++++++++++++++
+
+* danger_mode for automatic Response.raise_for_status()
+* Response.iter_lines refactor
+
+0.9.0 (2011-12-28)
+++++++++++++++++++
+
+* verify ssl is default.
+
+
+0.8.9 (2011-12-28)
+++++++++++++++++++
+
+* Packaging fix.
+
+
+0.8.8 (2011-12-28)
+++++++++++++++++++
+
+* SSL CERT VERIFICATION!
+* Release of Cerifi: Mozilla's cert list.
+* New 'verify' argument for SSL requests.
+* Urllib3 update.
+
+0.8.7 (2011-12-24)
+++++++++++++++++++
+
+* iter_lines last-line truncation fix
+* Force safe_mode for async requests
+* Handle safe_mode exceptions more consistently
+* Fix iteration on null responses in safe_mode
+
+0.8.6 (2011-12-18)
+++++++++++++++++++
+
+* Socket timeout fixes.
+* Proxy Authorization support.
+
+0.8.5 (2011-12-14)
+++++++++++++++++++
+
+* Response.iter_lines!
+
+0.8.4 (2011-12-11)
+++++++++++++++++++
+
+* Prefetch bugfix.
+* Added license to installed version.
+
+0.8.3 (2011-11-27)
+++++++++++++++++++
+
+* Converted auth system to use simpler callable objects.
+* New session parameter to API methods.
+* Display full URL while logging.
+
+0.8.2 (2011-11-19)
+++++++++++++++++++
+
+* New Unicode decoding system, based on over-ridable `Response.encoding`.
+* Proper URL slash-quote handling.
+* Cookies with ``[``, ``]``, and ``_`` allowed.
+
+0.8.1 (2011-11-15)
+++++++++++++++++++
+
+* URL Request path fix
+* Proxy fix.
+* Timeouts fix.
+
+0.8.0 (2011-11-13)
+++++++++++++++++++
+
+* Keep-alive support!
+* Complete removal of Urllib2
+* Complete removal of Poster
+* Complete removal of CookieJars
+* New ConnectionError raising
+* Safe_mode for error catching
+* prefetch parameter for request methods
+* OPTION method
+* Async pool size throttling
+* File uploads send real names
+* Vendored in urllib3
+
+0.7.6 (2011-11-07)
+++++++++++++++++++
+
+* Digest authentication bugfix (attach query data to path)
+
+0.7.5 (2011-11-04)
+++++++++++++++++++
+
+* Response.content = None if there was an invalid repsonse.
+* Redirection auth handling.
+
+0.7.4 (2011-10-26)
+++++++++++++++++++
+
+* Session Hooks fix.
+
+0.7.3 (2011-10-23)
+++++++++++++++++++
+
+* Digest Auth fix.
+
+
+0.7.2 (2011-10-23)
+++++++++++++++++++
+
+* PATCH Fix.
+
+
+0.7.1 (2011-10-23)
+++++++++++++++++++
+
+* Move away from urllib2 authentication handling.
+* Fully Remove AuthManager, AuthObject, &c.
+* New tuple-based auth system with handler callbacks.
+
+
+0.7.0 (2011-10-22)
+++++++++++++++++++
+
+* Sessions are now the primary interface.
+* Deprecated InvalidMethodException.
+* PATCH fix.
+* New config system (no more global settings).
+
+
+0.6.6 (2011-10-19)
+++++++++++++++++++
+
+* Session parameter bugfix (params merging).
+
+
+0.6.5 (2011-10-18)
+++++++++++++++++++
+
+* Offline (fast) test suite.
+* Session dictionary argument merging.
+
+
+0.6.4 (2011-10-13)
+++++++++++++++++++
+
+* Automatic decoding of unicode, based on HTTP Headers.
+* New ``decode_unicode`` setting.
+* Removal of ``r.read/close`` methods.
+* New ``r.faw`` interface for advanced response usage.*
+* Automatic expansion of parameterized headers.
+
+
+0.6.3 (2011-10-13)
+++++++++++++++++++
+
+* Beautiful ``requests.async`` module, for making async requests w/ gevent.
+
+
+0.6.2 (2011-10-09)
+++++++++++++++++++
+
+* GET/HEAD obeys allow_redirects=False.
+
+
+0.6.1 (2011-08-20)
+++++++++++++++++++
+
+* Enhanced status codes experience ``\o/``
+* Set a maximum number of redirects (``settings.max_redirects``)
+* Full Unicode URL support
+* Support for protocol-less redirects.
+* Allow for arbitrary request types.
+* Bugfixes
+
+
+0.6.0 (2011-08-17)
+++++++++++++++++++
+
+* New callback hook system
+* New persistient sessions object and context manager
+* Transparent Dict-cookie handling
+* Status code reference object
+* Removed Response.cached
+* Added Response.request
+* All args are kwargs
+* Relative redirect support
+* HTTPError handling improvements
+* Improved https testing
+* Bugfixes
+
+
+0.5.1 (2011-07-23)
+++++++++++++++++++
+
+* International Domain Name Support!
+* Access headers without fetching entire body (``read()``)
+* Use lists as dicts for parameters
+* Add Forced Basic Authentication
+* Forced Basic is default authentication type
+* ``python-requests.org`` default User-Agent header
+* CaseInsensitiveDict lower-case caching
+* Response.history bugfix
+
+
+0.5.0 (2011-06-21)
+++++++++++++++++++
+
+* PATCH Support
+* Support for Proxies
+* HTTPBin Test Suite
+* Redirect Fixes
+* settings.verbose stream writing
+* Querystrings for all methods
+* URLErrors (Connection Refused, Timeout, Invalid URLs) are treated as explicity raised
+ ``r.requests.get('hwe://blah'); r.raise_for_status()``
+
+
+0.4.1 (2011-05-22)
+++++++++++++++++++
+
+* Improved Redirection Handling
+* New 'allow_redirects' param for following non-GET/HEAD Redirects
+* Settings module refactoring
+
+
+0.4.0 (2011-05-15)
+++++++++++++++++++
+
+* Response.history: list of redirected responses
+* Case-Insensitive Header Dictionaries!
+* Unicode URLs
+
+
+0.3.4 (2011-05-14)
+++++++++++++++++++
+
+* Urllib2 HTTPAuthentication Recursion fix (Basic/Digest)
+* Internal Refactor
+* Bytes data upload Bugfix
+
+
+
+0.3.3 (2011-05-12)
+++++++++++++++++++
+
+* Request timeouts
+* Unicode url-encoded data
+* Settings context manager and module
+
+
+0.3.2 (2011-04-15)
+++++++++++++++++++
+
+* Automatic Decompression of GZip Encoded Content
+* AutoAuth Support for Tupled HTTP Auth
+
+
+0.3.1 (2011-04-01)
+++++++++++++++++++
+
+* Cookie Changes
+* Response.read()
+* Poster fix
+
+
+0.3.0 (2011-02-25)
+++++++++++++++++++
+
+* Automatic Authentication API Change
+* Smarter Query URL Parameterization
+* Allow file uploads and POST data together
+* New Authentication Manager System
+ - Simpler Basic HTTP System
+ - Supports all build-in urllib2 Auths
+ - Allows for custom Auth Handlers
+
+
+0.2.4 (2011-02-19)
+++++++++++++++++++
+
+* Python 2.5 Support
+* PyPy-c v1.4 Support
+* Auto-Authentication tests
+* Improved Request object constructor
+
+0.2.3 (2011-02-15)
+++++++++++++++++++
+
+* New HTTPHandling Methods
+ - Reponse.__nonzero__ (false if bad HTTP Status)
+ - Response.ok (True if expected HTTP Status)
+ - Response.error (Logged HTTPError if bad HTTP Status)
+ - Reponse.raise_for_status() (Raises stored HTTPError)
+
+
+0.2.2 (2011-02-14)
+++++++++++++++++++
+
+* Still handles request in the event of an HTTPError. (Issue #2)
+* Eventlet and Gevent Monkeypatch support.
+* Cookie Support (Issue #1)
+
+
+0.2.1 (2011-02-14)
+++++++++++++++++++
+
+* Added file attribute to POST and PUT requests for multipart-encode file uploads.
+* Added Request.url attribute for context and redirects
+
+
+0.2.0 (2011-02-14)
+++++++++++++++++++
+
+* Birth!
+
+
+0.0.1 (2011-02-13)
+++++++++++++++++++
+
+* Frustration
+* Conception
+
View
13 lib/python/vendor/requests-0.10.8/LICENSE
@@ -0,0 +1,13 @@
+Copyright (c) 2012 Kenneth Reitz.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
View
1  lib/python/vendor/requests-0.10.8/MANIFEST.in
@@ -0,0 +1 @@
+include README.rst LICENSE NOTICE HISTORY.rst test_requests.py
View
25 lib/python/vendor/requests-0.10.8/NOTICE
@@ -0,0 +1,25 @@
+Request includes some vendorized python libraries to ease installation.
+
+Urllib3 License
+===============
+
+This is the MIT license: http://www.opensource.org/licenses/mit-license.php
+
+Copyright 2008-2011 Andrey Petrov and contributors (see CONTRIBUTORS.txt),
+Modifications copyright 2022 Kenneth Reitz.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this
+software and associated documentation files (the "Software"), to deal in the Software
+without restriction, including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or
+substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
View
515 lib/python/vendor/requests-0.10.8/PKG-INFO
@@ -0,0 +1,515 @@
+Metadata-Version: 1.0
+Name: requests
+Version: 0.10.8
+Summary: Python HTTP for Humans.
+Home-page: http://python-requests.org
+Author: Kenneth Reitz
+Author-email: me@kennethreitz.com
+License: ISC
+Description: Requests: HTTP for Humans
+ =========================
+
+ .. image:: https://secure.travis-ci.org/kennethreitz/requests.png?branch=develop
+
+ Requests is an ISC Licensed HTTP library, written in Python, for human
+ beings.
+
+ Most existing Python modules for sending HTTP requests are extremely
+ verbose and cumbersome. Python's builtin urllib2 module provides most of
+ the HTTP capabilities you should need, but the api is thoroughly broken.
+ It requires an enormous amount of work (even method overrides) to
+ perform the simplest of tasks.
+
+ Things shouldn't be this way. Not in Python.
+
+ ::
+
+ >>> r = requests.get('https://api.github.com', auth=('user', 'pass'))
+ >>> r.status_code
+ 204
+ >>> r.headers['content-type']
+ 'application/json'
+ >>> r.text
+ ...
+
+ See `the same code, without Requests <https://gist.github.com/973705>`_.
+
+ Requests allow you to send **HEAD**, **GET**, **POST**, **PUT**,
+ **PATCH**, and **DELETE** HTTP requests. You can add headers, form data,
+ multipart files, and parameters with simple Python dictionaries, and access the
+ response data in the same way. It's powered by httplib and `urllib3
+ <https://github.com/shazow/urllib3>`_, but it does all the hard work and crazy
+ hacks for you.
+
+
+ Features
+ --------
+
+ - International Domains and URLs
+ - Keep-Alive & Connection Pooling
+ - Sessions with Cookie Persistence
+ - Browser-style SSL Verification
+ - Basic/Digest Authentication
+ - Elegant Key/Value Cookies
+ - Automatic Decompression
+ - Unicode Response Bodies
+ - Multipart File Uploads
+ - Connection Timeouts
+
+
+ Installation
+ ------------
+
+ To install requests, simply: ::
+
+ $ pip install requests
+
+ Or, if you absolutely must: ::
+
+ $ easy_install requests
+
+ But, you really shouldn't do that.
+
+
+
+ Contribute
+ ----------
+
+ #. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a Contributor Friendly tag for issues that should be ideal for people who are not very familiar with the codebase yet.
+ #. Fork `the repository`_ on Github to start making your changes to the **develop** branch (or branch off of it).
+ #. Write a test which shows that the bug was fixed or that the feature works as expected.
+ #. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_.
+
+ .. _`the repository`: http://github.com/kennethreitz/requests
+ .. _AUTHORS: http://github.com/kennethreitz/requests/blob/master/AUTHORS
+
+
+ History
+ -------
+
+ 0.10.8 (2012-03-09)
+ +++++++++++++++++++
+
+ * Generate chunked ValueError fix
+ * Proxy configuration by environment variables
+ * Simplification of iter_lines.
+ * New `trust_env` configuration for disabling system/environment hints.
+ * Suppress cookie errors.
+
+ 0.10.7 (2012-03-07)
+ +++++++++++++++++++
+
+ * `encode_uri` = False
+
+ 0.10.6 (2012-02-25)
+ +++++++++++++++++++
+
+ * Allow '=' in cookies.
+
+ 0.10.5 (2012-02-25)
+ +++++++++++++++++++
+
+ * Response body with 0 content-length fix.
+ * New async.imap.
+ * Don't fail on netrc.
+
+
+ 0.10.4 (2012-02-20)
+ +++++++++++++++++++
+
+ * Honor netrc.
+
+ 0.10.3 (2012-02-20)
+ +++++++++++++++++++
+
+ * HEAD requests don't follow redirects anymore.
+ * raise_for_status() doesn't raise for 3xx anymore.
+ * Make Session objects picklable.
+ * ValueError for invalid schema URLs.
+
+ 0.10.2 (2012-01-15)
+ +++++++++++++++++++
+
+ * Vastly improved URL quoting.
+ * Additional allowed cookie key values.
+ * Attempted fix for "Too many open files" Error
+ * Replace unicode errors on first pass, no need for second pass.
+ * Append '/' to bare-domain urls before query insertion.
+ * Exceptions now inherit from RuntimeError.
+ * Binary uploads + auth fix.
+ * Bugfixes.
+
+
+ 0.10.1 (2012-01-23)
+ +++++++++++++++++++
+
+ * PYTHON 3 SUPPORT!
+ * Dropped 2.5 Support. (*Backwards Incompatible*)
+
+ 0.10.0 (2012-01-21)
+ +++++++++++++++++++
+
+ * ``Response.content`` is now bytes-only. (*Backwards Incompatible*)
+ * New ``Response.text`` is unicode-only.
+ * If no ``Response.encoding`` is specified and ``chardet`` is available, ``Respoonse.text`` will guess an encoding.
+ * Default to ISO-8859-1 (Western) encoding for "text" subtypes.
+ * Removal of `decode_unicode`. (*Backwards Incompatible*)
+ * New multiple-hooks system.
+ * New ``Response.register_hook`` for registering hooks within the pipeline.
+ * ``Response.url`` is now Unicode.
+
+ 0.9.3 (2012-01-18)
+ ++++++++++++++++++
+
+ * SSL verify=False bugfix (apparent on windows machines).
+
+ 0.9.2 (2012-01-18)
+ ++++++++++++++++++
+
+ * Asynchronous async.send method.
+ * Support for proper chunk streams with boundaries.
+ * session argument for Session classes.
+ * Print entire hook tracebacks, not just exception instance.
+ * Fix response.iter_lines from pending next line.
+ * Fix but in HTTP-digest auth w/ URI having query strings.
+ * Fix in Event Hooks section.
+ * Urllib3 update.
+
+
+ 0.9.1 (2012-01-06)
+ ++++++++++++++++++
+
+ * danger_mode for automatic Response.raise_for_status()
+ * Response.iter_lines refactor
+
+ 0.9.0 (2011-12-28)
+ ++++++++++++++++++
+
+ * verify ssl is default.
+
+
+ 0.8.9 (2011-12-28)
+ ++++++++++++++++++
+
+ * Packaging fix.
+
+
+ 0.8.8 (2011-12-28)
+ ++++++++++++++++++
+
+ * SSL CERT VERIFICATION!
+ * Release of Cerifi: Mozilla's cert list.
+ * New 'verify' argument for SSL requests.
+ * Urllib3 update.
+
+ 0.8.7 (2011-12-24)
+ ++++++++++++++++++
+
+ * iter_lines last-line truncation fix
+ * Force safe_mode for async requests
+ * Handle safe_mode exceptions more consistently
+ * Fix iteration on null responses in safe_mode
+
+ 0.8.6 (2011-12-18)
+ ++++++++++++++++++
+
+ * Socket timeout fixes.
+ * Proxy Authorization support.
+
+ 0.8.5 (2011-12-14)
+ ++++++++++++++++++
+
+ * Response.iter_lines!
+
+ 0.8.4 (2011-12-11)
+ ++++++++++++++++++
+
+ * Prefetch bugfix.
+ * Added license to installed version.
+
+ 0.8.3 (2011-11-27)
+ ++++++++++++++++++
+
+ * Converted auth system to use simpler callable objects.
+ * New session parameter to API methods.
+ * Display full URL while logging.
+
+ 0.8.2 (2011-11-19)
+ ++++++++++++++++++
+
+ * New Unicode decoding system, based on over-ridable `Response.encoding`.
+ * Proper URL slash-quote handling.
+ * Cookies with ``[``, ``]``, and ``_`` allowed.
+
+ 0.8.1 (2011-11-15)
+ ++++++++++++++++++
+
+ * URL Request path fix
+ * Proxy fix.
+ * Timeouts fix.
+
+ 0.8.0 (2011-11-13)
+ ++++++++++++++++++
+
+ * Keep-alive support!
+ * Complete removal of Urllib2
+ * Complete removal of Poster
+ * Complete removal of CookieJars
+ * New ConnectionError raising
+ * Safe_mode for error catching
+ * prefetch parameter for request methods
+ * OPTION method
+ * Async pool size throttling
+ * File uploads send real names
+ * Vendored in urllib3
+
+ 0.7.6 (2011-11-07)
+ ++++++++++++++++++
+
+ * Digest authentication bugfix (attach query data to path)
+
+ 0.7.5 (2011-11-04)
+ ++++++++++++++++++
+
+ * Response.content = None if there was an invalid repsonse.
+ * Redirection auth handling.
+
+ 0.7.4 (2011-10-26)
+ ++++++++++++++++++
+
+ * Session Hooks fix.
+
+ 0.7.3 (2011-10-23)
+ ++++++++++++++++++
+
+ * Digest Auth fix.
+
+
+ 0.7.2 (2011-10-23)
+ ++++++++++++++++++
+
+ * PATCH Fix.
+
+
+ 0.7.1 (2011-10-23)
+ ++++++++++++++++++
+
+ * Move away from urllib2 authentication handling.
+ * Fully Remove AuthManager, AuthObject, &c.
+ * New tuple-based auth system with handler callbacks.
+
+
+ 0.7.0 (2011-10-22)
+ ++++++++++++++++++
+
+ * Sessions are now the primary interface.
+ * Deprecated InvalidMethodException.
+ * PATCH fix.
+ * New config system (no more global settings).
+
+
+ 0.6.6 (2011-10-19)
+ ++++++++++++++++++
+
+ * Session parameter bugfix (params merging).
+
+
+ 0.6.5 (2011-10-18)
+ ++++++++++++++++++
+
+ * Offline (fast) test suite.
+ * Session dictionary argument merging.
+
+
+ 0.6.4 (2011-10-13)
+ ++++++++++++++++++
+
+ * Automatic decoding of unicode, based on HTTP Headers.
+ * New ``decode_unicode`` setting.
+ * Removal of ``r.read/close`` methods.
+ * New ``r.faw`` interface for advanced response usage.*
+ * Automatic expansion of parameterized headers.
+
+
+ 0.6.3 (2011-10-13)
+ ++++++++++++++++++
+
+ * Beautiful ``requests.async`` module, for making async requests w/ gevent.
+
+
+ 0.6.2 (2011-10-09)
+ ++++++++++++++++++
+
+ * GET/HEAD obeys allow_redirects=False.
+
+
+ 0.6.1 (2011-08-20)
+ ++++++++++++++++++
+
+ * Enhanced status codes experience ``\o/``
+ * Set a maximum number of redirects (``settings.max_redirects``)
+ * Full Unicode URL support
+ * Support for protocol-less redirects.
+ * Allow for arbitrary request types.
+ * Bugfixes
+
+
+ 0.6.0 (2011-08-17)
+ ++++++++++++++++++
+
+ * New callback hook system
+ * New persistient sessions object and context manager
+ * Transparent Dict-cookie handling
+ * Status code reference object
+ * Removed Response.cached
+ * Added Response.request
+ * All args are kwargs
+ * Relative redirect support
+ * HTTPError handling improvements
+ * Improved https testing
+ * Bugfixes
+
+
+ 0.5.1 (2011-07-23)
+ ++++++++++++++++++
+
+ * International Domain Name Support!
+ * Access headers without fetching entire body (``read()``)
+ * Use lists as dicts for parameters
+ * Add Forced Basic Authentication
+ * Forced Basic is default authentication type
+ * ``python-requests.org`` default User-Agent header
+ * CaseInsensitiveDict lower-case caching
+ * Response.history bugfix
+
+
+ 0.5.0 (2011-06-21)
+ ++++++++++++++++++
+
+ * PATCH Support
+ * Support for Proxies
+ * HTTPBin Test Suite
+ * Redirect Fixes
+ * settings.verbose stream writing
+ * Querystrings for all methods
+ * URLErrors (Connection Refused, Timeout, Invalid URLs) are treated as explicity raised
+ ``r.requests.get('hwe://blah'); r.raise_for_status()``
+
+
+ 0.4.1 (2011-05-22)
+ ++++++++++++++++++
+
+ * Improved Redirection Handling
+ * New 'allow_redirects' param for following non-GET/HEAD Redirects
+ * Settings module refactoring
+
+
+ 0.4.0 (2011-05-15)
+ ++++++++++++++++++
+
+ * Response.history: list of redirected responses
+ * Case-Insensitive Header Dictionaries!
+ * Unicode URLs
+
+
+ 0.3.4 (2011-05-14)
+ ++++++++++++++++++
+
+ * Urllib2 HTTPAuthentication Recursion fix (Basic/Digest)
+ * Internal Refactor
+ * Bytes data upload Bugfix
+
+
+
+ 0.3.3 (2011-05-12)
+ ++++++++++++++++++
+
+ * Request timeouts
+ * Unicode url-encoded data
+ * Settings context manager and module
+
+
+ 0.3.2 (2011-04-15)
+ ++++++++++++++++++
+
+ * Automatic Decompression of GZip Encoded Content
+ * AutoAuth Support for Tupled HTTP Auth
+
+
+ 0.3.1 (2011-04-01)
+ ++++++++++++++++++
+
+ * Cookie Changes
+ * Response.read()
+ * Poster fix
+
+
+ 0.3.0 (2011-02-25)
+ ++++++++++++++++++
+
+ * Automatic Authentication API Change
+ * Smarter Query URL Parameterization
+ * Allow file uploads and POST data together
+ * New Authentication Manager System
+ - Simpler Basic HTTP System
+ - Supports all build-in urllib2 Auths
+ - Allows for custom Auth Handlers
+
+
+ 0.2.4 (2011-02-19)
+ ++++++++++++++++++
+
+ * Python 2.5 Support
+ * PyPy-c v1.4 Support
+ * Auto-Authentication tests
+ * Improved Request object constructor
+
+ 0.2.3 (2011-02-15)
+ ++++++++++++++++++
+
+ * New HTTPHandling Methods
+ - Reponse.__nonzero__ (false if bad HTTP Status)
+ - Response.ok (True if expected HTTP Status)
+ - Response.error (Logged HTTPError if bad HTTP Status)
+ - Reponse.raise_for_status() (Raises stored HTTPError)
+
+
+ 0.2.2 (2011-02-14)
+ ++++++++++++++++++
+
+ * Still handles request in the event of an HTTPError. (Issue #2)
+ * Eventlet and Gevent Monkeypatch support.
+ * Cookie Support (Issue #1)
+
+
+ 0.2.1 (2011-02-14)
+ ++++++++++++++++++
+
+ * Added file attribute to POST and PUT requests for multipart-encode file uploads.
+ * Added Request.url attribute for context and redirects
+
+
+ 0.2.0 (2011-02-14)
+ ++++++++++++++++++
+
+ * Birth!
+
+
+ 0.0.1 (2011-02-13)
+ ++++++++++++++++++
+
+ * Frustration
+ * Conception
+
+
+Platform: UNKNOWN
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Intended Audience :: Developers
+Classifier: Natural Language :: English
+Classifier: License :: OSI Approved :: ISC License (ISCL)
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.0
+Classifier: Programming Language :: Python :: 3.1
View
76 lib/python/vendor/requests-0.10.8/README.rst
@@ -0,0 +1,76 @@
+Requests: HTTP for Humans
+=========================
+
+.. image:: https://secure.travis-ci.org/kennethreitz/requests.png?branch=develop
+
+Requests is an ISC Licensed HTTP library, written in Python, for human
+beings.
+
+Most existing Python modules for sending HTTP requests are extremely
+verbose and cumbersome. Python's builtin urllib2 module provides most of
+the HTTP capabilities you should need, but the api is thoroughly broken.
+It requires an enormous amount of work (even method overrides) to
+perform the simplest of tasks.
+
+Things shouldn't be this way. Not in Python.
+
+::
+
+ >>> r = requests.get('https://api.github.com', auth=('user', 'pass'))
+ >>> r.status_code
+ 204
+ >>> r.headers['content-type']
+ 'application/json'
+ >>> r.text
+ ...
+
+See `the same code, without Requests <https://gist.github.com/973705>`_.
+
+Requests allow you to send **HEAD**, **GET**, **POST**, **PUT**,
+**PATCH**, and **DELETE** HTTP requests. You can add headers, form data,
+multipart files, and parameters with simple Python dictionaries, and access the
+response data in the same way. It's powered by httplib and `urllib3
+<https://github.com/shazow/urllib3>`_, but it does all the hard work and crazy
+hacks for you.
+
+
+Features
+--------
+
+- International Domains and URLs
+- Keep-Alive & Connection Pooling
+- Sessions with Cookie Persistence
+- Browser-style SSL Verification
+- Basic/Digest Authentication
+- Elegant Key/Value Cookies
+- Automatic Decompression
+- Unicode Response Bodies
+- Multipart File Uploads
+- Connection Timeouts
+
+
+Installation
+------------
+
+To install requests, simply: ::
+
+ $ pip install requests
+
+Or, if you absolutely must: ::
+
+ $ easy_install requests
+
+But, you really shouldn't do that.
+
+
+
+Contribute
+----------
+
+#. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a Contributor Friendly tag for issues that should be ideal for people who are not very familiar with the codebase yet.
+#. Fork `the repository`_ on Github to start making your changes to the **develop** branch (or branch off of it).
+#. Write a test which shows that the bug was fixed or that the feature works as expected.
+#. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_.
+
+.. _`the repository`: http://github.com/kennethreitz/requests
+.. _AUTHORS: http://github.com/kennethreitz/requests/blob/master/AUTHORS
View
515 lib/python/vendor/requests-0.10.8/requests.egg-info/PKG-INFO
@@ -0,0 +1,515 @@
+Metadata-Version: 1.0
+Name: requests
+Version: 0.10.8
+Summary: Python HTTP for Humans.
+Home-page: http://python-requests.org
+Author: Kenneth Reitz
+Author-email: me@kennethreitz.com
+License: ISC
+Description: Requests: HTTP for Humans
+ =========================
+
+ .. image:: https://secure.travis-ci.org/kennethreitz/requests.png?branch=develop
+
+ Requests is an ISC Licensed HTTP library, written in Python, for human
+ beings.
+
+ Most existing Python modules for sending HTTP requests are extremely
+ verbose and cumbersome. Python's builtin urllib2 module provides most of
+ the HTTP capabilities you should need, but the api is thoroughly broken.
+ It requires an enormous amount of work (even method overrides) to
+ perform the simplest of tasks.
+
+ Things shouldn't be this way. Not in Python.
+
+ ::
+
+ >>> r = requests.get('https://api.github.com', auth=('user', 'pass'))
+ >>> r.status_code
+ 204
+ >>> r.headers['content-type']
+ 'application/json'
+ >>> r.text
+ ...
+
+ See `the same code, without Requests <https://gist.github.com/973705>`_.
+
+ Requests allow you to send **HEAD**, **GET**, **POST**, **PUT**,
+ **PATCH**, and **DELETE** HTTP requests. You can add headers, form data,
+ multipart files, and parameters with simple Python dictionaries, and access the
+ response data in the same way. It's powered by httplib and `urllib3
+ <https://github.com/shazow/urllib3>`_, but it does all the hard work and crazy
+ hacks for you.
+
+
+ Features
+ --------
+
+ - International Domains and URLs
+ - Keep-Alive & Connection Pooling
+ - Sessions with Cookie Persistence
+ - Browser-style SSL Verification
+ - Basic/Digest Authentication
+ - Elegant Key/Value Cookies
+ - Automatic Decompression
+ - Unicode Response Bodies
+ - Multipart File Uploads
+ - Connection Timeouts
+
+
+ Installation
+ ------------
+
+ To install requests, simply: ::
+
+ $ pip install requests
+
+ Or, if you absolutely must: ::
+
+ $ easy_install requests
+
+ But, you really shouldn't do that.
+
+
+
+ Contribute
+ ----------
+
+ #. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a Contributor Friendly tag for issues that should be ideal for people who are not very familiar with the codebase yet.
+ #. Fork `the repository`_ on Github to start making your changes to the **develop** branch (or branch off of it).
+ #. Write a test which shows that the bug was fixed or that the feature works as expected.
+ #. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_.
+
+ .. _`the repository`: http://github.com/kennethreitz/requests
+ .. _AUTHORS: http://github.com/kennethreitz/requests/blob/master/AUTHORS
+
+
+ History
+ -------
+
+ 0.10.8 (2012-03-09)
+ +++++++++++++++++++
+
+ * Generate chunked ValueError fix
+ * Proxy configuration by environment variables
+ * Simplification of iter_lines.
+ * New `trust_env` configuration for disabling system/environment hints.
+ * Suppress cookie errors.
+
+ 0.10.7 (2012-03-07)
+ +++++++++++++++++++
+
+ * `encode_uri` = False
+
+ 0.10.6 (2012-02-25)
+ +++++++++++++++++++
+
+ * Allow '=' in cookies.
+
+ 0.10.5 (2012-02-25)
+ +++++++++++++++++++
+
+ * Response body with 0 content-length fix.
+ * New async.imap.
+ * Don't fail on netrc.
+
+
+ 0.10.4 (2012-02-20)
+ +++++++++++++++++++
+
+ * Honor netrc.
+
+ 0.10.3 (2012-02-20)
+ +++++++++++++++++++
+
+ * HEAD requests don't follow redirects anymore.
+ * raise_for_status() doesn't raise for 3xx anymore.
+ * Make Session objects picklable.
+ * ValueError for invalid schema URLs.
+
+ 0.10.2 (2012-01-15)
+ +++++++++++++++++++
+
+ * Vastly improved URL quoting.
+ * Additional allowed cookie key values.
+ * Attempted fix for "Too many open files" Error
+ * Replace unicode errors on first pass, no need for second pass.
+ * Append '/' to bare-domain urls before query insertion.
+ * Exceptions now inherit from RuntimeError.
+ * Binary uploads + auth fix.
+ * Bugfixes.
+
+
+ 0.10.1 (2012-01-23)
+ +++++++++++++++++++
+
+ * PYTHON 3 SUPPORT!
+ * Dropped 2.5 Support. (*Backwards Incompatible*)
+
+ 0.10.0 (2012-01-21)
+ +++++++++++++++++++
+
+ * ``Response.content`` is now bytes-only. (*Backwards Incompatible*)
+ * New ``Response.text`` is unicode-only.
+ * If no ``Response.encoding`` is specified and ``chardet`` is available, ``Respoonse.text`` will guess an encoding.
+ * Default to ISO-8859-1 (Western) encoding for "text" subtypes.
+ * Removal of `decode_unicode`. (*Backwards Incompatible*)
+ * New multiple-hooks system.
+ * New ``Response.register_hook`` for registering hooks within the pipeline.
+ * ``Response.url`` is now Unicode.
+
+ 0.9.3 (2012-01-18)
+ ++++++++++++++++++
+
+ * SSL verify=False bugfix (apparent on windows machines).
+
+ 0.9.2 (2012-01-18)
+ ++++++++++++++++++
+
+ * Asynchronous async.send method.
+ * Support for proper chunk streams with boundaries.
+ * session argument for Session classes.
+ * Print entire hook tracebacks, not just exception instance.
+ * Fix response.iter_lines from pending next line.
+ * Fix but in HTTP-digest auth w/ URI having query strings.
+ * Fix in Event Hooks section.
+ * Urllib3 update.
+
+
+ 0.9.1 (2012-01-06)
+ ++++++++++++++++++
+
+ * danger_mode for automatic Response.raise_for_status()
+ * Response.iter_lines refactor
+
+ 0.9.0 (2011-12-28)
+ ++++++++++++++++++
+
+ * verify ssl is default.
+
+
+ 0.8.9 (2011-12-28)
+ ++++++++++++++++++
+
+ * Packaging fix.
+
+
+ 0.8.8 (2011-12-28)
+ ++++++++++++++++++
+
+ * SSL CERT VERIFICATION!
+ * Release of Cerifi: Mozilla's cert list.
+ * New 'verify' argument for SSL requests.
+ * Urllib3 update.
+
+ 0.8.7 (2011-12-24)
+ ++++++++++++++++++
+
+ * iter_lines last-line truncation fix
+ * Force safe_mode for async requests
+ * Handle safe_mode exceptions more consistently
+ * Fix iteration on null responses in safe_mode
+
+ 0.8.6 (2011-12-18)
+ ++++++++++++++++++
+
+ * Socket timeout fixes.
+ * Proxy Authorization support.
+
+ 0.8.5 (2011-12-14)
+ ++++++++++++++++++
+
+ * Response.iter_lines!
+
+ 0.8.4 (2011-12-11)
+ ++++++++++++++++++
+
+ * Prefetch bugfix.
+ * Added license to installed version.
+
+ 0.8.3 (2011-11-27)
+ ++++++++++++++++++
+
+ * Converted auth system to use simpler callable objects.
+ * New session parameter to API methods.
+ * Display full URL while logging.
+
+ 0.8.2 (2011-11-19)
+ ++++++++++++++++++
+
+ * New Unicode decoding system, based on over-ridable `Response.encoding`.
+ * Proper URL slash-quote handling.
+ * Cookies with ``[``, ``]``, and ``_`` allowed.
+
+ 0.8.1 (2011-11-15)
+ ++++++++++++++++++
+
+ * URL Request path fix
+ * Proxy fix.
+ * Timeouts fix.
+
+ 0.8.0 (2011-11-13)
+ ++++++++++++++++++
+
+ * Keep-alive support!
+ * Complete removal of Urllib2
+ * Complete removal of Poster
+ * Complete removal of CookieJars
+ * New ConnectionError raising
+ * Safe_mode for error catching
+ * prefetch parameter for request methods
+ * OPTION method
+ * Async pool size throttling
+ * File uploads send real names
+ * Vendored in urllib3
+
+ 0.7.6 (2011-11-07)
+ ++++++++++++++++++
+
+ * Digest authentication bugfix (attach query data to path)
+
+ 0.7.5 (2011-11-04)
+ ++++++++++++++++++
+
+ * Response.content = None if there was an invalid repsonse.
+ * Redirection auth handling.
+
+ 0.7.4 (2011-10-26)
+ ++++++++++++++++++
+
+ * Session Hooks fix.
+
+ 0.7.3 (2011-10-23)
+ ++++++++++++++++++
+
+ * Digest Auth fix.
+
+
+ 0.7.2 (2011-10-23)
+ ++++++++++++++++++
+
+ * PATCH Fix.
+
+
+ 0.7.1 (2011-10-23)
+ ++++++++++++++++++
+
+ * Move away from urllib2 authentication handling.
+ * Fully Remove AuthManager, AuthObject, &c.
+ * New tuple-based auth system with handler callbacks.
+
+
+ 0.7.0 (2011-10-22)
+ ++++++++++++++++++
+
+ * Sessions are now the primary interface.
+ * Deprecated InvalidMethodException.
+ * PATCH fix.
+ * New config system (no more global settings).
+
+
+ 0.6.6 (2011-10-19)
+ ++++++++++++++++++
+
+ * Session parameter bugfix (params merging).
+
+
+ 0.6.5 (2011-10-18)
+ ++++++++++++++++++
+
+ * Offline (fast) test suite.
+ * Session dictionary argument merging.
+
+
+ 0.6.4 (2011-10-13)
+ ++++++++++++++++++
+
+ * Automatic decoding of unicode, based on HTTP Headers.
+ * New ``decode_unicode`` setting.
+ * Removal of ``r.read/close`` methods.
+ * New ``r.faw`` interface for advanced response usage.*
+ * Automatic expansion of parameterized headers.
+
+
+ 0.6.3 (2011-10-13)
+ ++++++++++++++++++
+
+ * Beautiful ``requests.async`` module, for making async requests w/ gevent.
+
+
+ 0.6.2 (2011-10-09)
+ ++++++++++++++++++
+
+ * GET/HEAD obeys allow_redirects=False.
+
+
+ 0.6.1 (2011-08-20)
+ ++++++++++++++++++
+
+ * Enhanced status codes experience ``\o/``
+ * Set a maximum number of redirects (``settings.max_redirects``)
+ * Full Unicode URL support
+ * Support for protocol-less redirects.
+ * Allow for arbitrary request types.
+ * Bugfixes
+
+
+ 0.6.0 (2011-08-17)
+ ++++++++++++++++++
+
+ * New callback hook system
+ * New persistient sessions object and context manager
+ * Transparent Dict-cookie handling
+ * Status code reference object
+ * Removed Response.cached
+ * Added Response.request
+ * All args are kwargs
+ * Relative redirect support
+ * HTTPError handling improvements
+ * Improved https testing
+ * Bugfixes
+
+
+ 0.5.1 (2011-07-23)
+ ++++++++++++++++++
+
+ * International Domain Name Support!
+ * Access headers without fetching entire body (``read()``)
+ * Use lists as dicts for parameters
+ * Add Forced Basic Authentication
+ * Forced Basic is default authentication type
+ * ``python-requests.org`` default User-Agent header
+ * CaseInsensitiveDict lower-case caching
+ * Response.history bugfix
+
+
+ 0.5.0 (2011-06-21)
+ ++++++++++++++++++
+
+ * PATCH Support
+ * Support for Proxies
+ * HTTPBin Test Suite
+ * Redirect Fixes
+ * settings.verbose stream writing
+ * Querystrings for all methods
+ * URLErrors (Connection Refused, Timeout, Invalid URLs) are treated as explicity raised
+ ``r.requests.get('hwe://blah'); r.raise_for_status()``
+
+
+ 0.4.1 (2011-05-22)
+ ++++++++++++++++++
+
+ * Improved Redirection Handling
+ * New 'allow_redirects' param for following non-GET/HEAD Redirects
+ * Settings module refactoring
+
+
+ 0.4.0 (2011-05-15)
+ ++++++++++++++++++
+
+ * Response.history: list of redirected responses
+ * Case-Insensitive Header Dictionaries!
+ * Unicode URLs
+
+
+ 0.3.4 (2011-05-14)
+ ++++++++++++++++++
+
+ * Urllib2 HTTPAuthentication Recursion fix (Basic/Digest)
+ * Internal Refactor
+ * Bytes data upload Bugfix
+
+
+
+ 0.3.3 (2011-05-12)
+ ++++++++++++++++++
+
+ * Request timeouts
+ * Unicode url-encoded data
+ * Settings context manager and module
+
+
+ 0.3.2 (2011-04-15)
+ ++++++++++++++++++
+
+ * Automatic Decompression of GZip Encoded Content
+ * AutoAuth Support for Tupled HTTP Auth
+
+
+ 0.3.1 (2011-04-01)
+ ++++++++++++++++++
+
+ * Cookie Changes
+ * Response.read()
+ * Poster fix
+
+
+ 0.3.0 (2011-02-25)
+ ++++++++++++++++++
+
+ * Automatic Authentication API Change
+ * Smarter Query URL Parameterization
+ * Allow file uploads and POST data together
+ * New Authentication Manager System
+ - Simpler Basic HTTP System
+ - Supports all build-in urllib2 Auths
+ - Allows for custom Auth Handlers
+
+
+ 0.2.4 (2011-02-19)
+ ++++++++++++++++++
+
+ * Python 2.5 Support
+ * PyPy-c v1.4 Support
+ * Auto-Authentication tests
+ * Improved Request object constructor
+
+ 0.2.3 (2011-02-15)
+ ++++++++++++++++++
+
+ * New HTTPHandling Methods
+ - Reponse.__nonzero__ (false if bad HTTP Status)
+ - Response.ok (True if expected HTTP Status)
+ - Response.error (Logged HTTPError if bad HTTP Status)
+ - Reponse.raise_for_status() (Raises stored HTTPError)
+
+
+ 0.2.2 (2011-02-14)
+ ++++++++++++++++++
+
+ * Still handles request in the event of an HTTPError. (Issue #2)
+ * Eventlet and Gevent Monkeypatch support.
+ * Cookie Support (Issue #1)
+
+
+ 0.2.1 (2011-02-14)
+ ++++++++++++++++++
+
+ * Added file attribute to POST and PUT requests for multipart-encode file uploads.
+ * Added Request.url attribute for context and redirects
+
+
+ 0.2.0 (2011-02-14)
+ ++++++++++++++++++
+
+ * Birth!
+
+
+ 0.0.1 (2011-02-13)
+ ++++++++++++++++++
+
+ * Frustration
+ * Conception
+
+
+Platform: UNKNOWN
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Intended Audience :: Developers
+Classifier: Natural Language :: English
+Classifier: License :: OSI Approved :: ISC License (ISCL)
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.0
+Classifier: Programming Language :: Python :: 3.1
View
41 lib/python/vendor/requests-0.10.8/requests.egg-info/SOURCES.txt
@@ -0,0 +1,41 @@
+HISTORY.rst
+LICENSE
+MANIFEST.in
+NOTICE
+README.rst
+setup.py
+requests/__init__.py
+requests/api.py
+requests/async.py
+requests/auth.py
+requests/compat.py
+requests/defaults.py
+requests/exceptions.py
+requests/hooks.py
+requests/models.py
+requests/sessions.py
+requests/status_codes.py
+requests/structures.py
+requests/utils.py
+requests.egg-info/PKG-INFO
+requests.egg-info/SOURCES.txt
+requests.egg-info/dependency_links.txt
+requests.egg-info/requires.txt
+requests.egg-info/top_level.txt
+requests/packages/__init__.py
+requests/packages/oreos/__init__.py
+requests/packages/oreos/core.py
+requests/packages/oreos/monkeys.py
+requests/packages/oreos/structures.py
+requests/packages/urllib3/__init__.py
+requests/packages/urllib3/_collections.py
+requests/packages/urllib3/connectionpool.py
+requests/packages/urllib3/exceptions.py
+requests/packages/urllib3/filepost.py
+requests/packages/urllib3/poolmanager.py
+requests/packages/urllib3/request.py
+requests/packages/urllib3/response.py
+requests/packages/urllib3/packages/__init__.py
+requests/packages/urllib3/packages/six.py
+requests/packages/urllib3/packages/mimetools_choose_boundary/__init__.py
+requests/packages/urllib3/packages/ssl_match_hostname/__init__.py
View
1  lib/python/vendor/requests-0.10.8/requests.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
View
2  lib/python/vendor/requests-0.10.8/requests.egg-info/requires.txt
@@ -0,0 +1,2 @@
+certifi>=0.0.7
+chardet>=1.0.0
View
1  lib/python/vendor/requests-0.10.8/requests.egg-info/top_level.txt
@@ -0,0 +1 @@
+requests
View
33 lib/python/vendor/requests-0.10.8/requests/__init__.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+
+# __
+# /__) _ _ _ _ _/ _
+# / ( (- (/ (/ (- _) / _)
+# /
+
+"""
+requests
+~~~~~~~~
+
+:copyright: (c) 2012 by Kenneth Reitz.
+:license: ISC, see LICENSE for more details.
+
+"""
+
+__title__ = 'requests'
+__version__ = '0.10.8'
+__build__ = 0x001008
+__author__ = 'Kenneth Reitz'
+__license__ = 'ISC'
+__copyright__ = 'Copyright 2012 Kenneth Reitz'
+
+
+from . import utils
+from .models import Request, Response
+from .api import request, get, head, post, patch, put, delete, options
+from .sessions import session, Session
+from .status_codes import codes
+from .exceptions import (
+ RequestException, Timeout, URLRequired,
+ TooManyRedirects, HTTPError, ConnectionError
+)
View
116 lib/python/vendor/requests-0.10.8/requests/api.py
@@ -0,0 +1,116 @@
+# -*- coding: utf-8 -*-
+
+"""
+requests.api
+~~~~~~~~~~~~
+
+This module implements the Requests API.
+
+:copyright: (c) 2012 by Kenneth Reitz.
+:license: ISC, see LICENSE for more details.
+
+"""
+
+from . import sessions
+
+def request(method, url, **kwargs):
+ """Constructs and sends a :class:`Request <Request>`.
+ Returns :class:`Response <Response>` object.
+
+ :param method: method for the new :class:`Request` object.
+ :param url: URL for the new :class:`Request` object.
+ :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`.
+ :param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.
+ :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`.
+ :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`.
+ :param files: (optional) Dictionary of 'name': file-like-objects (or {'name': ('filename', fileobj)}) for multipart encoding upload.
+ :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth.
+ :param timeout: (optional) Float describing the timeout of the request.
+ :param allow_redirects: (optional) Boolean. Set to True if POST/PUT/DELETE redirect following is allowed.
+ :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.
+ :param return_response: (optional) If False, an un-sent Request object will returned.
+ :param session: (optional) A :class:`Session` object to be used for the request.
+ :param config: (optional) A configuration dictionary.
+ :param verify: (optional) if ``True``, the SSL cert will be verified. A CA_BUNDLE path can also be provided.
+ :param prefetch: (optional) if ``True``, the response content will be immediately downloaded.
+ """
+
+ s = kwargs.pop('session') if 'session' in kwargs else sessions.session()
+ return s.request(method=method, url=url, **kwargs)
+
+
+
+def get(url, **kwargs):
+ """Sends a GET request. Returns :class:`Response` object.
+
+ :param url: URL for the new :class:`Request` object.
+ :param **kwargs: Optional arguments that ``request`` takes.
+ """
+
+ kwargs.setdefault('allow_redirects', True)
+ return request('get', url, **kwargs)
+
+
+def options(url, **kwargs):
+ """Sends a OPTIONS request. Returns :class:`Response` object.
+
+ :param url: URL for the new :class:`Request` object.
+ :param **kwargs: Optional arguments that ``request`` takes.
+ """
+
+ kwargs.setdefault('allow_redirects', True)
+ return request('options', url, **kwargs)
+
+
+def head(url, **kwargs):
+ """Sends a HEAD request. Returns :class:`Response` object.
+
+ :param url: URL for the new :class:`Request` object.
+ :param **kwargs: Optional arguments that ``request`` takes.
+ """
+
+ kwargs.setdefault('allow_redirects', False)
+ return request('head', url, **kwargs)
+
+
+def post(url, data=None, **kwargs):
+ """Sends a POST request. Returns :class:`Response` object.
+
+ :param url: URL for the new :class:`Request` object.
+ :param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.
+ :param **kwargs: Optional arguments that ``request`` takes.
+ """
+
+ return request('post', url, data=data, **kwargs)
+
+
+def put(url, data=None, **kwargs):
+ """Sends a PUT request. Returns :class:`Response` object.
+
+ :param url: URL for the new :class:`Request` object.
+ :param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.
+ :param **kwargs: Optional arguments that ``request`` takes.
+ """
+
+ return request('put', url, data=data, **kwargs)
+
+
+def patch(url, data=None, **kwargs):
+ """Sends a PATCH request. Returns :class:`Response` object.
+
+ :param url: URL for the new :class:`Request` object.
+ :param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.
+ :param **kwargs: Optional arguments that ``request`` takes.
+ """
+
+ return request('patch', url, data=data, **kwargs)
+
+
+def delete(url, **kwargs):
+ """Sends a DELETE request. Returns :class:`Response` object.
+
+ :param url: URL for the new :class:`Request` object.
+ :param **kwargs: Optional arguments that ``request`` takes.
+ """
+
+ return request('delete', url, **kwargs)
View
106 lib/python/vendor/requests-0.10.8/requests/async.py
@@ -0,0 +1,106 @@
+# -*- coding: utf-8 -*-
+
+"""
+requests.async
+~~~~~~~~~~~~~~
+
+This module contains an asynchronous replica of ``requests.api``, powered
+by gevent. All API methods return a ``Request`` instance (as opposed to
+``Response``). A list of requests can be sent with ``map()``.
+"""
+
+try:
+ import gevent
+ from gevent import monkey as curious_george
+ from gevent.pool import Pool
+except ImportError:
+ raise RuntimeError('Gevent is required for requests.async.')
+
+# Monkey-patch.
+curious_george.patch_all(thread=False)
+
+from . import api
+
+
+__all__ = (
+ 'map', 'imap',
+ 'get', 'options', 'head', 'post', 'put', 'patch', 'delete', 'request'
+)
+
+
+def patched(f):
+ """Patches a given API function to not send."""
+
+ def wrapped(*args, **kwargs):
+
+ kwargs['return_response'] = False
+ kwargs['prefetch'] = True
+
+ config = kwargs.get('config', {})
+ config.update(safe_mode=True)
+
+ kwargs['config'] = config
+
+ return f(*args, **kwargs)
+
+ return wrapped
+
+
+def send(r, pool=None, prefetch=False):
+ """Sends the request object using the specified pool. If a pool isn't
+ specified this method blocks. Pools are useful because you can specify size
+ and can hence limit concurrency."""
+
+ if pool != None:
+ return pool.spawn(r.send, prefetch=prefetch)
+
+ return gevent.spawn(r.send, prefetch=prefetch)
+
+
+# Patched requests.api functions.
+get = patched(api.get)
+options = patched(api.options)
+head = patched(api.head)
+post = patched(api.post)
+put = patched(api.put)
+patch = patched(api.patch)
+delete = patched(api.delete)
+request = patched(api.request)
+
+
+def map(requests, prefetch=True, size=None):
+ """Concurrently converts a list of Requests to Responses.
+
+ :param requests: a collection of Request objects.
+ :param prefetch: If False, the content will not be downloaded immediately.
+ :param size: Specifies the number of requests to make at a time. If None, no throttling occurs.
+ """
+
+ requests = list(requests)
+
+ pool = Pool(size) if size else None
+ jobs = [send(r, pool, prefetch=prefetch) for r in requests]
+ gevent.joinall(jobs)
+
+ return [r.response for r in requests]
+
+
+def imap(requests, prefetch=True, size=2):
+ """Concurrently converts a generator object of Requests to
+ a generator of Responses.
+
+ :param requests: a generator of Request objects.
+ :param prefetch: If False, the content will not be downloaded immediately.
+ :param size: Specifies the number of requests to make at a time. default is 2
+ """
+
+ pool = Pool(size)
+
+ def send(r):
+ r.send(prefetch)
+ return r.response
+
+ for r in pool.imap_unordered(send, requests):
+ yield r
+
+ pool.join()
View
148 lib/python/vendor/requests-0.10.8/requests/auth.py
@@ -0,0 +1,148 @@
+# -*- coding: utf-8 -*-
+
+"""
+requests.auth
+~~~~~~~~~~~~~
+
+This module contains the authentication handlers for Requests.
+"""
+
+import time
+import hashlib
+
+from base64 import b64encode
+from .compat import urlparse, str, bytes
+from .utils import randombytes, parse_dict_header
+
+
+
+def _basic_auth_str(username, password):
+ """Returns a Basic Auth string."""
+
+ return 'Basic ' + b64encode(('%s:%s' % (username, password)).encode('latin1')).strip().decode('latin1')
+
+
+class AuthBase(object):
+ """Base class that all auth implementations derive from"""
+
+ def __call__(self, r):
+ raise NotImplementedError('Auth hooks must be callable.')
+
+
+class HTTPBasicAuth(AuthBase):
+ """Attaches HTTP Basic Authentication to the given Request object."""
+ def __init__(self, username, password):
+ self.username = username
+ self.password = password
+
+ def __call__(self, r):
+ r.headers['Authorization'] = _basic_auth_str(self.username, self.password)
+ return r
+
+
+class HTTPProxyAuth(HTTPBasicAuth):
+ """Attaches HTTP Proxy Authenetication to a given Request object."""
+ def __call__(self, r):
+ r.headers['Proxy-Authorization'] = _basic_auth_str(self.username, self.password)
+ return r
+
+
+class HTTPDigestAuth(AuthBase):
+ """Attaches HTTP Digest Authentication to the given Request object."""
+ def __init__(self, username, password):
+ self.username = username
+ self.password = password
+
+ def handle_401(self, r):
+ """Takes the given response and tries digest-auth, if needed."""
+
+ s_auth = r.headers.get('www-authenticate', '')
+
+ if 'digest' in s_auth.lower():
+
+ last_nonce = ''
+ nonce_count = 0
+
+ chal = parse_dict_header(s_auth.replace('Digest ', ''))
+
+ realm = chal['realm']
+ nonce = chal['nonce']
+ qop = chal.get('qop')
+ algorithm = chal.get('algorithm', 'MD5')
+ opaque = chal.get('opaque', None)
+
+ algorithm = algorithm.upper()
+ # lambdas assume digest modules are imported at the top level
+ if algorithm == 'MD5':
+ def h(x):
+ if isinstance(x, str):
+ x = x.encode('utf-8')
+ return hashlib.md5(x).hexdigest()
+ H = h
+ elif algorithm == 'SHA':
+ def h(x):
+ if isinstance(x, str):
+ x = x.encode('utf-8')
+ return hashlib.sha1(x).hexdigest()
+ H = h
+ # XXX MD5-sess
+ KD = lambda s, d: H("%s:%s" % (s, d))
+
+ if H is None:
+ return None
+
+ # XXX not implemented yet
+ entdig = None
+ p_parsed = urlparse(r.request.url)
+ path = p_parsed.path
+ if p_parsed.query:
+ path += '?' + p_parsed.query
+
+ A1 = '%s:%s:%s' % (self.username, realm, self.password)
+ A2 = '%s:%s' % (r.request.method, path)
+
+ if qop == 'auth':
+ if nonce == last_nonce:
+ nonce_count += 1
+ else:
+ nonce_count = 1
+ last_nonce = nonce
+
+ ncvalue = '%08x' % nonce_count
+ s = str(nonce_count).encode('utf-8')
+ s += nonce.encode('utf-8')
+ s += time.ctime().encode('utf-8')
+ s += randombytes(8)
+
+ cnonce = (hashlib.sha1(s).hexdigest()[:16])
+ noncebit = "%s:%s:%s:%s:%s" % (nonce, ncvalue, cnonce, qop, H(A2))
+ respdig = KD(H(A1), noncebit)
+ elif qop is None:
+ respdig = KD(H(A1), "%s:%s" % (nonce, H(A2)))
+ else:
+ # XXX handle auth-int.
+ return None
+
+ # XXX should the partial digests be encoded too?
+ base = 'username="%s", realm="%s", nonce="%s", uri="%s", ' \
+ 'response="%s"' % (self.username, realm, nonce, path, respdig)
+ if opaque:
+ base += ', opaque="%s"' % opaque
+ if entdig:
+ base += ', digest="%s"' % entdig
+ base += ', algorithm="%s"' % algorithm
+ if qop:
+ base += ', qop=auth, nc=%s, cnonce="%s"' % (ncvalue, cnonce)
+
+ r.request.headers['Authorization'] = 'Digest %s' % (base)
+ r.request.send(anyway=True)
+ _r = r.request.response
+ _r.history.append(r)
+
+ return _r
+
+ return r
+
+ def __call__(self, r):
+ r.register_hook('response', self.handle_401)
+ return r
View
105 lib/python/vendor/requests-0.10.8/requests/compat.py
@@ -0,0 +1,105 @@
+# -*- coding: utf-8 -*-
+
+"""
+pythoncompat
+"""
+
+
+import sys
+
+# -------
+# Pythons
+# -------
+
+# Syntax sugar.
+_ver = sys.version_info
+
+#: Python 2.x?
+is_py2 = (_ver[0] == 2)
+
+#: Python 3.x?
+is_py3 = (_ver[0] == 3)
+
+#: Python 3.0.x
+is_py30 = (is_py3 and _ver[1] == 0)
+
+#: Python 3.1.x
+is_py31 = (is_py3 and _ver[1] == 1)
+
+#: Python 3.2.x
+is_py32 = (is_py3 and _ver[1] == 2)
+
+#: Python 3.3.x
+is_py33 = (is_py3 and _ver[1] == 3)
+
+#: Python 3.4.x
+is_py34 = (is_py3 and _ver[1] == 4)
+
+#: Python 2.7.x
+is_py27 = (is_py2 and _ver[1] == 7)
+
+#: Python 2.6.x
+is_py26 = (is_py2 and _ver[1] == 6)
+
+#: Python 2.5.x
+is_py25 = (is_py2 and _ver[1] == 5)
+
+#: Python 2.4.x
+is_py24 = (is_py2 and _ver[1] == 4) # I'm assuming this is not by choice.
+
+
+# ---------
+# Platforms
+# ---------
+
+
+# Syntax sugar.
+_ver = sys.version.lower()
+
+is_pypy = ('pypy' in _ver)
+is_jython = ('jython' in _ver)
+is_ironpython = ('iron' in _ver)
+
+# Assume CPython, if nothing else.
+is_cpython = not any((is_pypy, is_jython, is_ironpython))
+
+# Windows-based system.
+is_windows = 'win32' in str(sys.platform).lower()
+
+# Standard Linux 2+ system.
+is_linux = ('linux' in str(sys.platform).lower())
+is_osx = ('darwin' in str(sys.platform).lower())
+is_hpux = ('hpux' in str(sys.platform).lower()) # Complete guess.
+is_solaris = ('solar==' in str(sys.platform).lower()) # Complete guess.
+
+
+# ---------
+# Specifics
+# ---------
+
+
+if is_py2:
+ from urllib import quote, unquote, urlencode
+ from urlparse import urlparse, urlunparse, urljoin, urlsplit
+ from urllib2 import parse_http_list
+ import cookielib
+ from .packages.oreos.monkeys import SimpleCookie
+ from StringIO import StringIO
+
+ bytes = str
+ str = unicode
+ basestring = basestring
+
+
+
+elif is_py3:
+ from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote
+ from urllib.request import parse_http_list
+ from http import cookiejar as cookielib
+ from http.cookies import SimpleCookie
+ from io import StringIO
+
+ str = str
+ bytes = bytes
+ basestring = (str,bytes)
+
View
48 lib/python/vendor/requests-0.10.8/requests/defaults.py
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+
+"""
+requests.defaults
+~~~~~~~~~~~~~~~~~
+
+This module provides the Requests configuration defaults.
+
+Configurations:
+
+:base_headers: Default HTTP headers.
+:verbose: Stream to write request logging to.
+:max_redirects: Maximum number of redirects allowed within a request.s
+:keep_alive: Reuse HTTP Connections?
+:max_retries: The number of times a request should be retried in the event of a connection failure.
+:danger_mode: If true, Requests will raise errors immediately.
+:safe_mode: If true, Requests will catch all errors.
+:pool_maxsize: The maximium size of an HTTP connection pool.
+:pool_connections: The number of active HTTP connection pools to use.
+:encode_uri: If true, URIs will automatically be percent-encoded.
+:trust_env: If true, the surrouding environment will be trusted (environ, netrc).
+"""
+
+SCHEMAS = ['http', 'https']
+
+from . import __version__
+
+defaults = dict()
+
+
+defaults['base_headers'] = {
+ 'User-Agent': 'python-requests/%s' % __version__,
+ 'Accept-Encoding': ', '.join(('identity', 'deflate', 'compress', 'gzip')),
+ 'Accept': '*/*'
+}
+
+defaults['verbose'] = None
+defaults['max_redirects'] = 30
+defaults['pool_connections'] = 10
+defaults['pool_maxsize'] = 10
+defaults['max_retries'] = 0
+defaults['danger_mode'] = False
+defaults['safe_mode'] = False
+defaults['keep_alive'] = True
+defaults['encode_uri'] = True
+defaults['trust_env'] = True
+
+
View
32 lib/python/vendor/requests-0.10.8/requests/exceptions.py
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+
+"""
+requests.exceptions
+~~~~~~~~~~~~~~~~~~~
+
+This module contains the set of Requests' exceptions.
+
+"""
+
+class RequestException(RuntimeError):
+ """There was an ambiguous exception that occurred while handling your
+ request."""
+
+class HTTPError(RequestException):
+ """An HTTP error occurred."""
+ response = None
+
+class ConnectionError(RequestException):
+ """A Connection error occurred."""
+
+class SSLError(ConnectionError):
+ """An SSL error occurred."""
+
+class Timeout(RequestException):
+ """The request timed out."""
+
+class URLRequired(RequestException):
+ """A valid URL is required to make a request."""
+
+class TooManyRedirects(RequestException):
+ """Too many redirects."""
View
48 lib/python/vendor/requests-0.10.8/requests/hooks.py
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+
+"""
+requests.hooks
+~~~~~~~~~~~~~~
+
+This module provides the capabilities for the Requests hooks system.
+
+Available hooks:
+
+``args``:
+ A dictionary of the arguments being sent to Request().
+
+``pre_request``:
+ The Request object, directly before being sent.
+
+``post_request``:
+ The Request object, directly after being sent.
+
+``response``:
+ The response generated from a Request.
+
+"""
+
+import traceback
+
+
+HOOKS = ('args', 'pre_request', 'post_request', 'response')
+
+
+def dispatch_hook(key, hooks, hook_data):
+ """Dispatches a hook dictionary on a given piece of data."""
+
+ hooks = hooks or dict()
+
+ if key in hooks:
+ hooks = hooks.get(key)
+
+ if hasattr(hooks, '__call__'):
+ hooks = [hooks]
+
+ for hook in hooks:
+ try:
+ hook_data = hook(hook_data) or hook_data
+ except Exception:
+ traceback.print_exc()
+
+ return hook_data
View
816 lib/python/vendor/requests-0.10.8/requests/models.py
@@ -0,0 +1,816 @@
+# -*- coding: utf-8 -*-
+
+"""
+requests.models
+~~~~~~~~~~~~~~~
+
+This module contains the primary objects that power Requests.
+"""
+
+import os
+from datetime import datetime
+
+from .hooks import dispatch_hook, HOOKS
+from .structures import CaseInsensitiveDict
+from .status_codes import codes
+
+from .auth import HTTPBasicAuth, HTTPProxyAuth
+from .packages.urllib3.response import HTTPResponse
+from .packages.urllib3.exceptions import MaxRetryError
+from .packages.urllib3.exceptions import SSLError as _SSLError
+from .packages.urllib3.exceptions import HTTPError as _HTTPError
+from .packages.urllib3 import connectionpool, poolmanager
+from .packages.urllib3.filepost import encode_multipart_formdata
+from .defaults import SCHEMAS
+from .exceptions import (
+ ConnectionError, HTTPError, RequestException, Timeout, TooManyRedirects,
+ URLRequired, SSLError)
+from .utils import (
+ get_encoding_from_headers, stream_untransfer, guess_filename, requote_uri,
+ dict_from_string, stream_decode_response_unicode, get_netrc_auth)
+from .compat import (
+ urlparse, urlunparse, urljoin, urlsplit, urlencode, str, bytes,
+ SimpleCookie, is_py2)
+
+# Import chardet if it is available.
+try:
+ import chardet
+except ImportError:
+ pass
+
+REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved)
+
+
+class Request(object):
+ """The :class:`Request <Request>` object. It carries out all functionality of
+ Requests. Recommended interface is with the Requests functions.
+ """
+
+ def __init__(self,
+ url=None,
+ headers=dict(),
+ files=None,
+ method=None,
+ data=dict(),
+ params=dict(),
+ auth=None,
+ cookies=None,
+ timeout=None,
+ redirect=False,
+ allow_redirects=False,
+ proxies=None,
+ hooks=None,
+ config=None,
+ _poolmanager=None,
+ verify=None,
+ session=None):
+
+ #: Dictionary of configurations for this request.
+ self.config = dict(config or [])
+
+ #: Float describes the timeout of the request.
+ # (Use socket.setdefaulttimeout() as fallback)
+ self.timeout = timeout