Skip to content

Commit 8ae7c5d

Browse files
committed
Added InvalidPortException and init
1 parent 5032c3e commit 8ae7c5d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

external_samples/component.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ class PortType(Enum):
99
I2C_PORT = 5
1010
USB_PORT = 6
1111

12+
class InvalidPortException(Exception):
13+
pass
14+
1215
# This is an abstract class
1316
class Component:
17+
@abstractmethod
18+
def __init__(self, ports : list[tuple[PortType, int]]):
19+
pass
1420
# This is the manufacturer of the component
1521
@abstractmethod
1622
def get_manufacturer(self) -> str:

0 commit comments

Comments
 (0)