Skip to content

Commit

Permalink
use words instead of abbreviations
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Oct 18, 2023
1 parent 927725e commit 4967bb8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
4 changes: 2 additions & 2 deletions spinnman/messages/scp/impl/iptag_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions spinnman/model/cpu_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,29 +258,29 @@ 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

@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

@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
Expand Down
10 changes: 5 additions & 5 deletions spinnman/spalloc/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
13 changes: 8 additions & 5 deletions spinnman/spalloc/spalloc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 4967bb8

Please sign in to comment.