Skip to content

Commit

Permalink
pep8 and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Peter committed May 28, 2024
1 parent 94d107e commit 4f3814a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions spyder_kernels/comms/commbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def __init__(self, call_name, call_id):
self.tb = traceback.extract_tb(tb)

def to_json(self):
"""Create JSON representation."""
return {
"call_name": self.call_name,
"call_id": self.call_id,
Expand All @@ -112,6 +113,7 @@ def to_json(self):

@classmethod
def from_json(cls, json_data):
"""Get a CommsErrorWrapper from a JSON representation."""
instance = cls.__new__(cls)
instance.call_name = json_data["call_name"]
instance.call_id = json_data["call_id"]
Expand Down Expand Up @@ -253,8 +255,8 @@ def remote_call(self, comm_id=None, callback=None, **settings):

# ---- Private -----
def _send_message(
self, spyder_msg_type, content=None, comm_id=None, buffers=None
):
self, spyder_msg_type, content=None, comm_id=None, buffers=None
):
"""
Publish custom messages to the other side.
Expand All @@ -264,10 +266,11 @@ def _send_message(
The spyder message type
content: dict
The (JSONable) content of the message
data: any
Any object that is serializable by json.
comm_id: int
the comm to send to. If None sends to all comms.
buffers: list(bytes)
a list of bytes to send
"""
if not self.is_open(comm_id):
raise CommError("The comm is not connected.")
Expand Down

0 comments on commit 4f3814a

Please sign in to comment.