From: Luke Kenneth Casson Leighton Date: Thu, 25 Jun 2020 09:31:35 +0000 (+0100) Subject: update docstring on add_prefix_to_record_signals X-Git-Tag: 24jan2021_ls180~50 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2281b4652f857fc6609eb2854aaf9daa9d5ace4d;p=nmutil.git update docstring on add_prefix_to_record_signals --- 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)