diff --git a/src/epplibwrapper/client.py b/src/epplibwrapper/client.py index 8cdb85fad..66d3d696c 100644 --- a/src/epplibwrapper/client.py +++ b/src/epplibwrapper/client.py @@ -65,11 +65,16 @@ class EPPLibWrapper: # Pool size "size": settings.EPP_CONNECTION_POOL_SIZE, # Which errors the pool should look out for - "exc_classes": (LoginError, RegistryError,), - # Occasionally pings the registry to keep the connection alive + "exc_classes": ( + LoginError, + RegistryError, + ), + # Occasionally pings the registry to keep the connection alive "keepalive": settings.POOL_KEEP_ALIVE, } - self._pool = EppConnectionPool(client=self._client, login=self._login, options=options) + self._pool = EppConnectionPool( + client=self._client, login=self._login, options=options + ) def _send(self, command): """Helper function used by `send`.""" diff --git a/src/epplibwrapper/socket.py b/src/epplibwrapper/socket.py index 703ac9538..d66589495 100644 --- a/src/epplibwrapper/socket.py +++ b/src/epplibwrapper/socket.py @@ -35,7 +35,7 @@ class Socket: self.client.close() raise LoginError(response.msg) return self.client - + def disconnect(self): """Close the connection.""" try: @@ -43,7 +43,7 @@ class Socket: self.client.close() except Exception: logger.warning("Connection to registry was not cleanly closed.") - + def send(self, command): logger.debug(f"command is this: {command}") response = self.client.send(command) @@ -53,4 +53,4 @@ class Socket: self.client.close() raise LoginError(response.msg) """ - return response \ No newline at end of file + return response diff --git a/src/epplibwrapper/utility/pool.py b/src/epplibwrapper/utility/pool.py index 2ad9f82c2..6682f3bf6 100644 --- a/src/epplibwrapper/utility/pool.py +++ b/src/epplibwrapper/utility/pool.py @@ -10,6 +10,7 @@ except ImportError: logger = logging.getLogger(__name__) + class EppConnectionPool(ConnectionPool): def __init__(self, client, login, options): # For storing shared credentials @@ -35,8 +36,8 @@ class EppConnectionPool(ConnectionPool): except Exception as err: logger.error("Failed to keep the connection alive.", exc_info=True) raise RegistryError("Failed to keep the connection alive.") from err - + def create_socket(self, client, login) -> Socket: """Creates and returns a socket instance""" socket = Socket(client, login) - return socket \ No newline at end of file + return socket