diff --git a/examples/rudimentarystreams.py b/examples/rudimentarystreams.py index 4621682..f8b0f64 100644 --- a/examples/rudimentarystreams.py +++ b/examples/rudimentarystreams.py @@ -10,7 +10,6 @@ async def subscribe_to_signal(): - async with connect_to_glasses.with_hostname(os.environ["G3_HOSTNAME"]) as g3: imu_queue, unsubscribe = await g3.rudimentary.subscribe_to_imu() diff --git a/src/g3pylib/__init__.py b/src/g3pylib/__init__.py index 86a0409..efd47a6 100644 --- a/src/g3pylib/__init__.py +++ b/src/g3pylib/__init__.py @@ -202,7 +202,8 @@ def __init__( The regular use cases are covered in the alternative constructors below: `with_url`, `with_zeroconf`, `with_hostname` and `with_service`. If you want to use this constructor you need to supply a couroutine which returns a tuple that contains two URLs. - The first URL should point to the websocket and the second URL should point to the RTSP endpoint.""" + The first URL should point to the websocket and the second URL should point to the RTSP endpoint. + """ self.url_generator = url_generator @staticmethod @@ -251,7 +252,8 @@ def with_zeroconf( If `using_ip` is set to True (default) we will generate the the URL used for connection with the ip. If it's set to False we will use the hostname, which will depend on DNS working as it should. - `timeout` defines the time in milliseconds before `asyncio.TimeoutError` is raised.""" + `timeout` defines the time in milliseconds before `asyncio.TimeoutError` is raised. + """ return cls(cls._urls_from_zeroconf(using_ip, timeout)) @classmethod diff --git a/src/g3pylib/streams.py b/src/g3pylib/streams.py index f47c8ad..ee8990e 100644 --- a/src/g3pylib/streams.py +++ b/src/g3pylib/streams.py @@ -143,7 +143,8 @@ def from_rtp_payload(cls, rtp_payload: bytes) -> NALUnit: def from_fu_a(cls, fu_a: FUA) -> NALUnit: """Constructs `NALUnit` from an FUA. - Note that fragmented NAL unit payloads must be aggregated before they can get parsed.""" + Note that fragmented NAL unit payloads must be aggregated before they can get parsed. + """ header = fu_a.header & (cls._F_MASK | cls._NRI_MASK) | fu_a.original_type data = bytearray() data.append(header) @@ -153,7 +154,8 @@ def from_fu_a(cls, fu_a: FUA) -> NALUnit: class FUA(NALUnit): """A specific type of RTP NAL unit called FU-A (Fragmentation Unit type A). - Described in detail in RFC 6184 section [5.8](https://datatracker.ietf.org/doc/html/rfc6184#section-5.8).""" + Described in detail in RFC 6184 section [5.8](https://datatracker.ietf.org/doc/html/rfc6184#section-5.8). + """ @cached_property def s(self) -> int: @@ -400,7 +402,8 @@ async def demux( """Returns a queue with tuples containing the demuxed RTP stream along with timestamps. Spawns a demuxer task which parses the NAL units received in the RTP payloads. - It also aggregates fragmentation units of larger NAL units sent in multiple RTP packets.""" + It also aggregates fragmentation units of larger NAL units sent in multiple RTP packets. + """ nal_unit_queue: asyncio.Queue[Tuple[NALUnit, Optional[float]]] = asyncio.Queue( FRAME_QUEUE_SIZE ) diff --git a/src/g3pylib/websocket/__init__.py b/src/g3pylib/websocket/__init__.py index 16030ee..54d89da 100644 --- a/src/g3pylib/websocket/__init__.py +++ b/src/g3pylib/websocket/__init__.py @@ -54,7 +54,8 @@ class SignalSubscriptionHandler(ABC): def _init_signal_subscription_handling(self) -> None: """Initialize a subclass inheriting `SignalSubscriptionHandler` with the properties needed - to handle signal subscriptions. **Has to be run in the constructor of the inheriting subclass.**""" + to handle signal subscriptions. **Has to be run in the constructor of the inheriting subclass.** + """ self._subscription_count = 0 self._signal_id_by_uri: Dict[URI, SignalId] = {} self._signal_queues_by_id: Dict[