Skip to content

Commit

Permalink
Add Optional Attribute list param to Part ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
nbes4 committed May 5, 2024
1 parent bc92688 commit c5db34a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions entities/device.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from os import makedirs, path

from typing import Iterable, List
from typing import Iterable, List, Optional

from common import escape_string
from entities.attribute import Attribute
Expand Down Expand Up @@ -37,10 +37,10 @@ def __init__(self, manufacturer: str):


class Part():
def __init__(self, mpn: str, manufacturer: Manufacturer):
def __init__(self, mpn: str, manufacturer: Manufacturer, attributes: Optional[List[Attribute]] = None):
self.mpn = mpn
self.manufacturer = manufacturer
self.attributes = [] # type: List[Attribute]
self.attributes = attributes or []

def __str__(self) -> str:
ret = '(part "{}" {}\n'.format(escape_string(self.mpn), self.manufacturer)
Expand Down

0 comments on commit c5db34a

Please sign in to comment.