Only allow 1-sized Libraries
This commit is contained in:
parent
4a94259249
commit
4a6584a60a
@ -587,12 +587,15 @@ class MutableLibrary(Library, MutableMapping[str, 'Pattern'], metaclass=ABCMeta)
|
|||||||
self.add(tree.library, rename_theirs=rename_theirs)
|
self.add(tree.library, rename_theirs=rename_theirs)
|
||||||
return name
|
return name
|
||||||
|
|
||||||
def __lshift__(self, other: Mapping[str, 'Pattern']) -> Optional[str]:
|
def __lshift__(self, other: Mapping[str, 'Pattern']) -> str:
|
||||||
if isinstance(other, Tree):
|
if isinstance(other, Tree):
|
||||||
return self.add_tree(other) # Add library and return topcell name
|
return self.add_tree(other) # Add library and return topcell name
|
||||||
|
|
||||||
name = next(other.keys()) if len(other) == 1 else None # If only one name, return it
|
if len(other) != 1:
|
||||||
lib.add(other)
|
raise LibraryError('Received a non-Tree library containing multiple cells')
|
||||||
|
|
||||||
|
name = next(iter(other))
|
||||||
|
self.add(other)
|
||||||
return name
|
return name
|
||||||
|
|
||||||
def dedup(
|
def dedup(
|
||||||
|
Loading…
Reference in New Issue
Block a user