Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Cleaned up some formatting suggested by black (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashogstrom authored Feb 7, 2023
1 parent 260039d commit 7c127f6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
1 change: 0 additions & 1 deletion examples/rudimentarystreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
6 changes: 4 additions & 2 deletions src/g3pylib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions src/g3pylib/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down Expand Up @@ -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
)
Expand Down
3 changes: 2 additions & 1 deletion src/g3pylib/websocket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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[
Expand Down

0 comments on commit 7c127f6

Please sign in to comment.