From 2281b4652f857fc6609eb2854aaf9daa9d5ace4d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 25 Jun 2020 10:31:35 +0100 Subject: [PATCH] update docstring on add_prefix_to_record_signals --- src/nmutil/iocontrol.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nmutil/iocontrol.py b/src/nmutil/iocontrol.py index 2bd7896..20bb8d6 100644 --- a/src/nmutil/iocontrol.py +++ b/src/nmutil/iocontrol.py @@ -74,12 +74,15 @@ class Object: def add_prefix_to_record_signals(prefix, record): + """recursively hunt through Records, modifying names to add a prefix + """ for key, val in record.fields.items(): if isinstance(val, Signal): val.name = prefix + val.name elif isinstance(val, Record): add_prefix_to_record_signals(prefix, val) + class RecordObject(Record): def __init__(self, layout=None, name=None): Record.__init__(self, layout=layout or [], name=name) -- 2.30.2