@@ -137,9 +137,24 @@ def enhanced_by_auth(f):
137137class GithubCommand (object ):
138138
139139 def __init__ (self , request ):
140+ """Main API binding interface
141+
142+ :param github2.request.GithubRequest request: HTTP request handler
143+ """
140144 self .request = request
141145
142146 def make_request (self , command , * args , ** kwargs ):
147+ """Make an API request
148+
149+ Various options are supported if they exist in ``kwargs``:
150+
151+ * The value of a ``method`` argument will define the HTTP method
152+ to perform for this request, the default is ``GET``
153+ * The value of a ``filter`` argument will restrict the response to that
154+ data
155+ * The value of a ``page`` argument will be used to fetch a specific
156+ page of results, default of 1 is assumed if not given
157+ """
143158 filter = kwargs .get ("filter" )
144159 post_data = kwargs .get ("post_data" ) or {}
145160 page = kwargs .pop ("page" , 1 )
@@ -162,6 +177,11 @@ def make_request(self, command, *args, **kwargs):
162177 return response
163178
164179 def get_value (self , * args , ** kwargs ):
180+ """Process a single-value response from the API
181+
182+ If a ``datatype`` parameter is given it defines the
183+ :class:`BaseData`-derived class we should build from the provided data
184+ """
165185 datatype = kwargs .pop ("datatype" , None )
166186 value = self .make_request (* args , ** kwargs )
167187 if datatype :
@@ -176,6 +196,10 @@ def get_value(self, *args, **kwargs):
176196 return value
177197
178198 def get_values (self , * args , ** kwargs ):
199+ """Process a multi-value response from the API
200+
201+ :see: :meth:`get_value`
202+ """
179203 datatype = kwargs .pop ("datatype" , None )
180204 values = self .make_request (* args , ** kwargs )
181205 if datatype :
@@ -208,8 +232,11 @@ def bullet(title, text):
208232
209233
210234class Attribute (object ):
211-
212235 def __init__ (self , help ):
236+ """Generic object attribute for use with :class:`BaseData`
237+
238+ :param str help: Attribute description
239+ """
213240 self .help = help
214241
215242 def to_python (self , value ):
@@ -228,6 +255,11 @@ class DateAttribute(Attribute):
228255 }
229256
230257 def __init__ (self , * args , ** kwargs ):
258+ """Date handling attribute for use with :class:`BaseData`
259+
260+ :param str format: The date format to support, see
261+ :data:`convertor_for_format` for supported options
262+ """
231263 self .format = kwargs .pop ("format" , self .format )
232264 super (DateAttribute , self ).__init__ (* args , ** kwargs )
233265
@@ -280,6 +312,12 @@ def iterate(self):
280312# Ugly base class definition for Python 2 and 3 compatibility, where metaclass
281313# syntax is incompatible
282314class BaseData (BaseDataType ('BaseData' , (object , ), {})):
315+ """Wrapper for API responses
316+
317+ .. warning::
318+ Supports subscript attribute access purely for backwards compatibility,
319+ you shouldn't rely on that functionality in new code
320+ """
283321 def __getitem__ (self , key ):
284322 """Access objects's attribute using subscript notation
285323
@@ -296,7 +334,7 @@ def __getitem__(self, key):
296334 def __setitem__ (self , key , value ):
297335 """Update object's attribute using subscript notation
298336
299- :see: `` BaseData.__getitem__` `
337+ :see: :meth:` BaseData.__getitem__`
300338 """
301339 LOGGER .warning ("Subscript access on %r is deprecated, use object "
302340 "attributes" % self .__class__ .__name__ ,
0 commit comments