@@ -84,8 +84,7 @@ def connect(self):
8484 self .register_apis ()
8585
8686 def find_next (self ):
87- """ Find the next url in the list
88- """
87+ """Find the next url in the list"""
8988 if int (self .num_retries ) < 0 : # pragma: no cover
9089 self ._cnt_retries += 1
9190 sleeptime = (self ._cnt_retries - 1 ) * 2 if self ._cnt_retries < 10 else 10
@@ -119,8 +118,7 @@ def find_next(self):
119118 return url
120119
121120 def reset_counter (self ):
122- """ reset the failed connection counters
123- """
121+ """reset the failed connection counters"""
124122 self ._cnt_retries = 0
125123 for i in self ._url_counter :
126124 self ._url_counter [i ] = 0
@@ -141,34 +139,34 @@ def post_process_exception(self, exception):
141139
142140 @property
143141 def api_id (self ):
144- """ This allows to list api_ids, if they have been registered through
145- api_register() -- LEGACY
142+ """This allows to list api_ids, if they have been registered through
143+ api_register() -- LEGACY
146144
147- In previous API version, one would connect and register to APIs
148- like this
145+ In previous API version, one would connect and register to APIs
146+ like this
149147
150- .. code-block:: python
148+ .. code-block:: python
151149
152- self.api_id["database"] = self.database(api_id=1)
153- self.api_id["history"] = self.history(api_id=1)
154- self.api_id["network_broadcast"] = self.network_broadcast(
155- api_id=1)
150+ self.api_id["database"] = self.database(api_id=1)
151+ self.api_id["history"] = self.history(api_id=1)
152+ self.api_id["network_broadcast"] = self.network_broadcast(
153+ api_id=1)
156154
157155 """
158156 return self .connection .api_id
159157
160158 def register_apis (self ): # pragma: no cover
161- """ This method is called right after connection and has previously
162- been used to register to different APIs within the backend that are
163- considered default. The requirement to register to APIs has been
164- removed in some systems.
159+ """This method is called right after connection and has previously
160+ been used to register to different APIs within the backend that are
161+ considered default. The requirement to register to APIs has been
162+ removed in some systems.
165163 """
166164 pass
167165
168166 def __getattr__ (self , name ):
169- """ Proxies RPC calls to actual Websocket or Http instance.
167+ """Proxies RPC calls to actual Websocket or Http instance.
170168
171- Connection-related errors catched here and handled.
169+ Connection-related errors catched here and handled.
172170 """
173171
174172 def func (* args , ** kwargs ):
@@ -182,8 +180,7 @@ def func(*args, **kwargs):
182180 except KeyboardInterrupt : # pragma: no cover
183181 raise
184182 except RPCError as e : # pragma: no cover
185- """ When the backend actual returns an error
186- """
183+ """When the backend actual returns an error"""
187184 self .post_process_exception (e )
188185 # the above line should raise. Let's be sure to at least
189186 # break
@@ -197,8 +194,7 @@ def func(*args, **kwargs):
197194 self .error_url ()
198195 self .next ()
199196 except Exception as e : # pragma: no cover
200- """ When something fails talking to the backend
201- """
197+ """When something fails talking to the backend"""
202198 import traceback
203199
204200 log .debug (traceback .format_exc ())
0 commit comments