@@ -94,7 +94,7 @@ def return_socket(self):
9494 self .sock = None
9595
9696
97- class Connection (object ): # TODO support auth for pooling
97+ class Connection (object ): # TODO support auth for pooling
9898 """Connection to MongoDB.
9999 """
100100
@@ -189,7 +189,8 @@ def __partition(source, sub):
189189 i = source .find (sub )
190190 if i == - 1 :
191191 return (source , None )
192- return (source [:i ], source [i + len (sub ):])
192+
193+ return (source [:i ], source [i + len (sub ):])
193194
194195 @staticmethod
195196 def _parse_uri (uri ):
@@ -198,7 +199,8 @@ def _parse_uri(uri):
198199 if uri .startswith ("mongodb://" ):
199200 uri = uri [len ("mongodb://" ):]
200201 elif "://" in uri :
201- raise InvalidURI ("Invalid uri scheme: %s" % Connection .__partition (uri , "://" )[0 ])
202+ raise InvalidURI ("Invalid uri scheme: %s"
203+ % Connection .__partition (uri , "://" )[0 ])
202204
203205 (hosts , database ) = Connection .__partition (uri , "/" )
204206
@@ -211,7 +213,8 @@ def _parse_uri(uri):
211213 (auth , hosts ) = Connection .__partition (hosts , "@" )
212214
213215 if ":" not in auth :
214- raise InvalidURI ("auth must be specified as 'username:password@'" )
216+ raise InvalidURI ("auth must be specified as "
217+ "'username:password@'" )
215218 (username , password ) = Connection .__partition (auth , ":" )
216219
217220 host_list = []
@@ -441,7 +444,7 @@ def __find_master(self):
441444 self .__port = port
442445 return
443446 except socket .error , e :
444- sock_error = True
447+ sock_error = True
445448 finally :
446449 if sock is not None :
447450 sock .close ()
@@ -499,9 +502,10 @@ def set_cursor_manager(self, manager_class):
499502 """Set this connection's cursor manager.
500503
501504 Raises :class:`TypeError` if `manager_class` is not a subclass of
502- :class:`~pymongo.cursor_manager.CursorManager`. A cursor manager handles
503- closing cursors. Different managers can implement different policies in
504- terms of when to actually kill a cursor that has been closed.
505+ :class:`~pymongo.cursor_manager.CursorManager`. A cursor manager
506+ handles closing cursors. Different managers can implement different
507+ policies in terms of when to actually kill a cursor that has
508+ been closed.
505509
506510 :Parameters:
507511 - `manager_class`: cursor manager to use
@@ -562,7 +566,8 @@ def _send_message(self, message, with_last_error=False):
562566 # lastError) and raise OperationFailure if it is an error
563567 # response.
564568 if with_last_error :
565- response = self .__receive_message_on_socket (1 , request_id , sock )
569+ response = self .__receive_message_on_socket (1 , request_id ,
570+ sock )
566571 return self .__check_response_to_last_error (response )
567572 return None
568573 except (ConnectionFailure , socket .error ), e :
0 commit comments