diff --git a/spinnman/messages/scp/impl/iptag_get.py b/spinnman/messages/scp/impl/iptag_get.py index 5000e47ef..6947356fe 100644 --- a/spinnman/messages/scp/impl/iptag_get.py +++ b/spinnman/messages/scp/impl/iptag_get.py @@ -169,8 +169,8 @@ def is_temporary(self): @property def is_arp(self): """ - Whether the tag is in the ARP state (where the MAC address is - being looked up). + Whether the tag is in the Address Resolution Protocol state + (where the MAC address is being looked up). .. note:: This is a transient state; it is unlikely to be observed. diff --git a/spinnman/model/cpu_info.py b/spinnman/model/cpu_info.py index 478a28ce5..d4e5ef935 100644 --- a/spinnman/model/cpu_info.py +++ b/spinnman/model/cpu_info.py @@ -258,9 +258,9 @@ def software_source_line_number(self): @property def processor_state_register(self): """ - The value in the processor state register (PSR). + The value in the processor state register. - :return: The PSR value + :return: The processor state register value :rtype: int """ return self._processor_state_register @@ -268,9 +268,9 @@ def processor_state_register(self): @property def stack_pointer(self): """ - The current stack pointer value (SP). + The current stack pointer value. - :return: The SP value + :return: The stack pointervalue :rtype: int """ return self._stack_pointer @@ -278,9 +278,9 @@ def stack_pointer(self): @property def link_register(self): """ - The current link register value (LR). + The current link register value. - :return: The LR value + :return: The link register value :rtype: int """ return self._link_register diff --git a/spinnman/spalloc/session.py b/spinnman/spalloc/session.py index 98b0dc314..0953feac3 100644 --- a/spinnman/spalloc/session.py +++ b/spinnman/spalloc/session.py @@ -139,20 +139,20 @@ def get(self, url: str, timeout: int = 10, **kwargs) -> requests.Response: return self.__handle_error_or_return(r) @_may_renew - def post(self, url: str, jsonobj: dict, timeout: int = 10, + def post(self, url: str, json_dict: dict, timeout: int = 10, **kwargs) -> requests.Response: """ Do an HTTP ``POST`` in the session. :param str url: :param int timeout: - :param dict jsonobj: + :param dict json_dict: :rtype: ~requests.Response :raise ValueError: If the server rejects a request """ params = kwargs if kwargs else None cookies, headers = self._credentials - r = requests.post(url, params=params, json=jsonobj, + r = requests.post(url, params=params, json=json_dict, cookies=cookies, headers=headers, allow_redirects=False, timeout=timeout) logger.debug("POST {} returned {}", url, r.status_code) @@ -340,8 +340,8 @@ def _service_url(self): def _get(self, url: str, **kwargs) -> requests.Response: return self.__session.get(url, **kwargs) - def _post(self, url: str, jsonobj: dict, **kwargs) -> requests.Response: - return self.__session.post(url, jsonobj, **kwargs) + def _post(self, url: str, json_dict: dict, **kwargs) -> requests.Response: + return self.__session.post(url, json_dict, **kwargs) def _put(self, url: str, data: str, **kwargs) -> requests.Response: return self.__session.put(url, data, **kwargs) diff --git a/spinnman/spalloc/spalloc_client.py b/spinnman/spalloc/spalloc_client.py index e905f41af..487c10a07 100644 --- a/spinnman/spalloc/spalloc_client.py +++ b/spinnman/spalloc/spalloc_client.py @@ -97,6 +97,7 @@ def __init__( if username is None and password is None: service_url, username, password = parse_service_url(service_url) self.__session = Session(service_url, username, password, bearer_token) + self.__session = Session(service_url, username, password, bearer_token) obj = self.__session.renew() v = obj["version"] self.version = Version( @@ -673,7 +674,8 @@ def __repr__(self): class _ProxiedConnection(metaclass=AbstractBase): """ - Core mux/demux emulating a connection that is proxied over a websocket. + Core multiplexer/demultiplexer emulating a connection that is proxied + over a websocket. None of the methods are public because subclasses may expose a profile of them to conform to a particular type of connection. @@ -693,12 +695,12 @@ def __init__(self, ws: WebSocket, receiver: _ProxyReceiver): def _open_connection(self) -> int: pass - def _call(self, proto: ProxyProtocol, packer: struct.Struct, + def _call(self, protocol: ProxyProtocol, packer: struct.Struct, unpacker: struct.Struct, *args) -> List[int]: """ Do a synchronous call. - :param proto: + :param protocol: The protocol message number. :param packer: How to form the protocol message. The first two arguments passed @@ -721,7 +723,7 @@ def _call(self, proto: ProxyProtocol, packer: struct.Struct, # All calls via websocket use correlation_id correlation_id = self.__receiver.expect_return( self.__call_queue.put) - self.__ws.send_binary(packer.pack(proto, correlation_id, *args)) + self.__ws.send_binary(packer.pack(protocol, correlation_id, *args)) if not self._connected: raise IOError("socket closed after send!") reply = self.__call_queue.get() @@ -731,7 +733,8 @@ def _call(self, proto: ProxyProtocol, packer: struct.Struct, payload = reply[_msg.size:].decode("utf-8") if len(payload): raise _ProxyServiceError(payload) - raise _ProxyServiceError(f"unknown problem with {proto} call") + raise _ProxyServiceError( + f"unknown problem with {protocol} call") return unpacker.unpack(reply)[2:] @property