Skip to content

Commit 7be744c

Browse files
committed
allow single string as signal list for I/O system
1 parent 089936f commit 7be744c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

control/iosys.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,11 @@ def _process_signal_list(self, signals, prefix='s'):
363363

364364
elif isinstance(signals, int):
365365
# Number of signals given; make up the names
366-
return signals, {'x[%d]' % i: i for i in range(signals)}
366+
return signals, {'%s[%d]' % (prefix, i): i for i in range(signals)}
367+
368+
elif isinstance(signals, str):
369+
# Single string given => single signal with given name
370+
return 1, {signals: 0}
367371

368372
elif all(isinstance(s, str) for s in signals):
369373
# Use the list of strings as the signal names

0 commit comments

Comments
 (0)