library can generate abstracts
This commit is contained in:
parent
e288c3f5e0
commit
0368cf7a00
@ -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())) + '>'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user