libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1348695 - in /libcloud/trunk/libcloud: common/base.py compute/base.py compute/drivers/cloudstack.py compute/drivers/dummy.py
Date Mon, 11 Jun 2012 00:28:38 GMT
Author: tomaz
Date: Mon Jun 11 00:28:38 2012
New Revision: 1348695

URL: http://svn.apache.org/viewvc?rev=1348695&view=rev
Log:
Add @requires annotation for required arguments to some methods. Contributed by
Ilgiz Islamgulov, part of LIBCLOUD-210.

Modified:
    libcloud/trunk/libcloud/common/base.py
    libcloud/trunk/libcloud/compute/base.py
    libcloud/trunk/libcloud/compute/drivers/cloudstack.py
    libcloud/trunk/libcloud/compute/drivers/dummy.py

Modified: libcloud/trunk/libcloud/common/base.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/common/base.py?rev=1348695&r1=1348694&r2=1348695&view=diff
==============================================================================
--- libcloud/trunk/libcloud/common/base.py (original)
+++ libcloud/trunk/libcloud/common/base.py Mon Jun 11 00:28:38 2012
@@ -124,7 +124,7 @@ class Response(object):
 
         body = response.read()
 
-        if encoding in  ['zlib', 'deflate']:
+        if encoding in ['zlib', 'deflate']:
             body = decompress_data('zlib', body)
         elif encoding in ['gzip', 'x-gzip']:
             body = decompress_data('gzip', body)
@@ -138,6 +138,7 @@ class JsonResponse(Response):
     """
     A Base JSON Response class to derive from.
     """
+
     def parse_body(self):
         if len(self.body) == 0 and not self.parse_zero_length_body:
             return self.body
@@ -158,6 +159,7 @@ class XmlResponse(Response):
     """
     A Base XML Response class to derive from.
     """
+
     def parse_body(self):
         if len(self.body) == 0 and not self.parse_zero_length_body:
             return self.body
@@ -254,7 +256,7 @@ class LoggingConnection():
 
         encoding = headers.get('content-encoding', None)
 
-        if encoding in  ['zlib', 'deflate']:
+        if encoding in ['zlib', 'deflate']:
             body = decompress_data('zlib', body)
         elif encoding in ['gzip', 'x-gzip']:
             body = decompress_data('gzip', body)
@@ -802,7 +804,9 @@ class BaseDriver(object):
                                  which support multiple API versions.
         @type       api_version: str
 
+        @requires: key, secret
         """
+
         self.key = key
         self.secret = secret
         self.secure = secure

Modified: libcloud/trunk/libcloud/compute/base.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/base.py?rev=1348695&r1=1348694&r2=1348695&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/base.py (original)
+++ libcloud/trunk/libcloud/compute/base.py Mon Jun 11 00:28:38 2012
@@ -393,6 +393,9 @@ class NodeDriver(BaseDriver):
 
     def __init__(self, key, secret=None, secure=True, host=None, port=None,
                  api_version=None, **kwargs):
+        """
+        @requires: key, secret
+        """
         super(NodeDriver, self).__init__(key=key, secret=secret, secure=secure,
                                          host=host, port=port,
                                          api_version=api_version, **kwargs)

Modified: libcloud/trunk/libcloud/compute/drivers/cloudstack.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/drivers/cloudstack.py?rev=1348695&r1=1348694&r2=1348695&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/drivers/cloudstack.py (original)
+++ libcloud/trunk/libcloud/compute/drivers/cloudstack.py Mon Jun 11 00:28:38 2012
@@ -125,6 +125,9 @@ class CloudStackNodeDriver(CloudStackDri
 
     def __init__(self, key, secret=None, secure=True, host=None,
                  path=None, port=None, *args, **kwargs):
+        """
+        @requires: key, secret, host or path
+        """
         host = host if host else self.host
 
         if path is not None:

Modified: libcloud/trunk/libcloud/compute/drivers/dummy.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/drivers/dummy.py?rev=1348695&r1=1348694&r2=1348695&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/drivers/dummy.py (original)
+++ libcloud/trunk/libcloud/compute/drivers/dummy.py Mon Jun 11 00:28:38 2012
@@ -67,6 +67,9 @@ class DummyNodeDriver(NodeDriver):
     type = Provider.DUMMY
 
     def __init__(self, creds):
+        """
+        @requires: creds
+        """
         self.creds = creds
         try:
             num = int(creds)



Mime
View raw message