Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

docstrings and stuff

  • Loading branch information...
commit 58fdf428b6ff4feddaf94acab84cc9b63b701636 1 parent 42ae14e
Piotr Zalewa authored October 08, 2012

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. 8  marketplace/connection.py
8  marketplace/connection.py
@@ -34,6 +34,7 @@ class Connection:
34 34
     Marketplace API
35 35
     """
36 36
     signature_method = oauth.SignatureMethod_HMAC_SHA1()
  37
+    consumer = None
37 38
 
38 39
     def __init__(self, consumer_key, consumer_secret):
39 40
         self.set_consumer(consumer_key, consumer_secret)
@@ -63,7 +64,7 @@ def prepare_request(self, method, url, body=''):
63 64
 
64 65
     @staticmethod
65 66
     def _get_error_reason(response):
66  
-        """extract error reason from the response. It might be either
  67
+        """Extract error reason from the response. It might be either
67 68
         the 'reason' or the entire response
68 69
         """
69 70
         body = response.json
@@ -72,6 +73,9 @@ def _get_error_reason(response):
72 73
         return response.content
73 74
 
74 75
     def fetch(self, method, url, data=None, expected_status_code=None):
  76
+        """Prepare the headers, encode data, call API and provide
  77
+        data it returns
  78
+        """
75 79
         kwargs = self.prepare_request(method, url, data)
76 80
         response = getattr(requests, method.lower())(url, **kwargs)
77 81
         if response.status_code >= 400:
@@ -82,4 +86,6 @@ def fetch(self, method, url, data=None, expected_status_code=None):
82 86
         return response
83 87
 
84 88
     def fetch_json(self, method, url, data=None, expected_status_code=None):
  89
+        """Return json decoded data from fetch
  90
+        """
85 91
         return self.fetch(method, url, data, expected_status_code).json()

0 notes on commit 58fdf42

Please sign in to comment.
Something went wrong with that request. Please try again.