From 5446a8c40b7c42ce0ea3f92c81bf7b1ef22c9cd9 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sat, 4 Feb 2023 09:06:31 -0800 Subject: [PATCH] add Pather.mk() --- masque/builder/builder.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/masque/builder/builder.py b/masque/builder/builder.py index 8fa52dd..add2e8d 100644 --- a/masque/builder/builder.py +++ b/masque/builder/builder.py @@ -604,6 +604,19 @@ class Pather(Builder): if name is not None: library[name] = self.pattern + @classmethod + def mk( + cls, + library: MutableLibrary, + base_name: str, + *, + ports: Union[None, str, Mapping[str, Port]] = None, + tools: Union[None, Tool, MutableMapping[Optional[str], Tool]] = None, + ) -> Tuple['Pather', str]: + """ Name-and-make combination """ + pat = library.create(base_name) + pather = Pather(library, pattern=pat, ports=ports, tools=tools) + return pather, pat.name @classmethod def from_builder(