Skip to content

Commit 8fbd17b

Browse files
committed
Fix syntax errors
1 parent 852ec42 commit 8fbd17b

9 files changed

Lines changed: 7 additions & 1999 deletions

chaski/streamer_sync.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
import asyncio
1919
import threading
2020
import inspect
21-
import typing
22-
import logging
21+
from typing import Generator, Any
2322

2423
from chaski.streamer import ChaskiStreamer
2524

@@ -75,7 +74,7 @@ def __init__(self, *args, **kwargs):
7574
# This function sets the given event loop as the current event loop and starts it to run indefinitely, enabling asynchronous tasks.
7675
asyncio.set_event_loop(self.loop)
7776

78-
self.streamer = ChaskiStreamer(*args, **kwargs, run=False, sync=True)
77+
self.streamer = ChaskiStreamer(*args, **kwargs, sync=True, run=False)
7978

8079
# Start a new thread that runs the event loop, allowing for asynchronous operations to occur in parallel.
8180
self.thread = threading.Thread(target=self._start_loop, args=(self.loop,))
@@ -94,8 +93,8 @@ def __repr__(self):
9493
such as the IP address and port. If the instance is a root node, it prepends an
9594
asterisk (*) to the string.
9695
"""
97-
h = '*' if self.paired else ''
98-
return h + self.address.replace('ChaskiStreamer', 'ChaskiStreamerSync')
96+
h = "*" if self.paired else ""
97+
return h + self.address.replace("ChaskiStreamer", "ChaskiStreamerSync")
9998

10099
# ----------------------------------------------------------------------
101100
def _start_loop(self, loop: asyncio.AbstractEventLoop) -> None:
@@ -148,7 +147,7 @@ def close(self) -> None:
148147
self.thread.join()
149148

150149
# ----------------------------------------------------------------------
151-
def __getattr__(self, attr: str) -> typing.Any:
150+
def __getattr__(self, attr: str) -> Any:
152151
"""Retrieve an attribute from the ChaskiStreamer instance.
153152
154153
This method overrides the default behavior of attribute access,
@@ -190,7 +189,7 @@ def wrapp(*args, **kwargs):
190189
return object_
191190

192191
# ----------------------------------------------------------------------
193-
def message_stream(self, timeout=None) -> typing.Generator['Message', None, None]:
192+
def message_stream(self, timeout=None) -> Generator:
194193
"""
195194
Generator to yield messages from the streamer's message queue.
196195
@@ -206,7 +205,7 @@ def message_stream(self, timeout=None) -> typing.Generator['Message', None, None
206205
207206
Returns
208207
-------
209-
None
208+
Generator
210209
If the queue times out or an exception occurs.
211210
"""
212211
while True:

docs/source/notebooks/01-chaski_node.pct.ipynb

Lines changed: 0 additions & 508 deletions
This file was deleted.

docs/source/notebooks/01-chaski_node.pct.py

Lines changed: 0 additions & 242 deletions
This file was deleted.

0 commit comments

Comments
 (0)