From 4788fa3ca514c7f1a59f7ff52ad15713a3d51e90 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Wed, 23 Jun 2021 22:39:12 -0700 Subject: [PATCH] add Device.rename() --- masque/builder/devices.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/masque/builder/devices.py b/masque/builder/devices.py index 74e7b72..202531a 100644 --- a/masque/builder/devices.py +++ b/masque/builder/devices.py @@ -724,6 +724,19 @@ class Device(Copyable, Mirrorable): self._dead = True return self + def rename(self: D, name: str) -> D: + """ + Renames the pattern and returns the device + + Args: + name: The new name + + Returns: + self + """ + self.name = name + return self + def __repr__(self) -> str: s = f'