libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [1/4] git commit: Add some missing docstring annotations.
Date Sun, 08 Dec 2013 00:01:53 GMT
Updated Branches:
  refs/heads/trunk 2148ba866 -> 5f687665a


Add some missing docstring annotations.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/66d9e18e
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/66d9e18e
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/66d9e18e

Branch: refs/heads/trunk
Commit: 66d9e18e80c9d45b10b4893e5c19b606f09df853
Parents: 2148ba8
Author: Tomaz Muraus <tomaz@apache.org>
Authored: Sat Dec 7 23:51:55 2013 +0100
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Sat Dec 7 23:53:46 2013 +0100

----------------------------------------------------------------------
 libcloud/common/base.py | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/66d9e18e/libcloud/common/base.py
----------------------------------------------------------------------
diff --git a/libcloud/common/base.py b/libcloud/common/base.py
index 5ffd182..a57f658 100644
--- a/libcloud/common/base.py
+++ b/libcloud/common/base.py
@@ -79,6 +79,13 @@ class Response(object):
     parse_zero_length_body = False
 
     def __init__(self, response, connection):
+        """
+        :param response: HTTP response object. (optional)
+        :type response: :class:`httplib.HTTPResponse`
+
+        :param connection: Parent connection object.
+        :type connection: :class:`.Connection`
+        """
         self.body = self._decompress_response(response=response)
 
         if PY3:
@@ -104,6 +111,7 @@ class Response(object):
         Override in a provider's subclass.
 
         :return: Parsed body.
+        :rtype: ``str``
         """
         return self.body
 
@@ -114,6 +122,7 @@ class Response(object):
         Override in a provider's subclass.
 
         :return: Parsed error.
+        :rtype: ``str``
         """
         return self.body
 
@@ -134,6 +143,7 @@ class Response(object):
         Decompress a response body if it is using deflate or gzip encoding.
 
         :return: Decompressed response
+        :rtype: ``str``
         """
         headers = lowercase_keys(dict(response.getheaders()))
         encoding = headers.get('content-encoding', None)
@@ -168,7 +178,7 @@ class JsonResponse(Response):
             body = json.loads(self.body)
         except:
             raise MalformedResponseError(
-                "Failed to parse JSON",
+                'Failed to parse JSON',
                 body=self.body,
                 driver=self.connection.driver)
         return body
@@ -199,6 +209,10 @@ class XmlResponse(Response):
 class RawResponse(Response):
 
     def __init__(self, connection):
+        """
+        :param connection: Parent connection object.
+        :type connection: :class:`.Connection`
+        """
         self._status = None
         self._response = None
         self._headers = {}


Mime
View raw message