From 0368cf7a00b0443a30903aed90cc221f197e661e Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 23 Jan 2023 22:34:58 -0800 Subject: [PATCH] library can generate abstracts --- masque/library.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/masque/library.py b/masque/library.py index 6e846fa..cb44baf 100644 --- a/masque/library.py +++ b/masque/library.py @@ -22,6 +22,7 @@ from .label import Label if TYPE_CHECKING: from .pattern import Pattern + from .builder import Abstract 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 + def abstract(self, name: str) -> 'Abstract': + return Abstract(name=name, ports=self[name].ports) + def __repr__(self) -> str: return ''