Skip to content

Commit 91a62e5

Browse files
committed
Add missing docstrings
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
1 parent 8ea68f9 commit 91a62e5

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

uhubctl/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Wrapper module for uhubctl"""
2+
13
import re
24
import subprocess
35
from typing import List, Optional
@@ -21,7 +23,7 @@ def _uhubctl(args: list = None) -> list:
2123

2224
if stderr.startswith("No compatible devices detected"):
2325
return []
24-
26+
2527
raise Exception(f"uhubctl failed: {stderr}") from exc
2628

2729

@@ -48,6 +50,9 @@ def discover_hubs():
4850

4951

5052
class Hub:
53+
"""
54+
USB hub representation from uhubctl
55+
"""
5156
def __init__(self, path: str, enumerate_ports: bool = False) -> None:
5257
"""
5358
Create new hub instance
@@ -124,6 +129,9 @@ def __str__(self) -> str:
124129

125130

126131
class Port:
132+
"""
133+
USB port representation from uhubctl
134+
"""
127135
def __init__(self, hub: Hub, port_number: int):
128136
"""
129137
Create new port instance
@@ -138,6 +146,9 @@ def __init__(self, hub: Hub, port_number: int):
138146

139147
@property
140148
def status(self) -> bool:
149+
"""
150+
Port power status
151+
"""
141152
status = None
142153
pattern = re.compile(fr" Port {self.port_number}: \d{{4}} (power|off)")
143154

0 commit comments

Comments
 (0)