library can generate abstracts

This commit is contained in:
Jan Petykiewicz 2023-01-23 22:34:58 -08:00
parent 09b7ecd80e
commit 2302d29433

View File

@ -22,6 +22,7 @@ from .label import Label
if TYPE_CHECKING: if TYPE_CHECKING:
from .pattern import Pattern from .pattern import Pattern
from .builder import Abstract
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -41,6 +42,9 @@ class Library(Mapping[str, Pattern], metaclass=ABCMeta):
#__contains__, keys, items, values, get, __eq__, __ne__ supplied by Mapping #__contains__, keys, items, values, get, __eq__, __ne__ supplied by Mapping
def abstract(self, name: str) -> 'Abstract':
return Abstract(name=name, ports=self[name].ports)
def __repr__(self) -> str: def __repr__(self) -> str:
return '<Library with keys ' + repr(list(self.keys())) + '>' return '<Library with keys ' + repr(list(self.keys())) + '>'