From 587305497ff59efbea52b6369e83a4359dea3d4e Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Fri, 2 Jun 2023 21:17:07 -0700 Subject: [PATCH] add retool() --- masque/builder/renderpather.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/masque/builder/renderpather.py b/masque/builder/renderpather.py index b97e0e6..6f3a40f 100644 --- a/masque/builder/renderpather.py +++ b/masque/builder/renderpather.py @@ -290,6 +290,18 @@ class RenderPather(PortList): self.pattern.refs[other.name].append(ref) return self + def retool( + self, + tool: Tool, + keys: str | Sequence[str | None] | None = None, + ) -> Self: + if keys is None or isinstance(keys, str): + self.tools[keys] = tool + else: + for key in keys: + self.tools[key] = tool + return self + def path( self, portspec: str,