Skip to content

Commit

Permalink
cmds as list of lists
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-usielski committed Jan 11, 2024
1 parent ba915ef commit f4cf33c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions moler/event_awaiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ def start_command_after_event(cls, cmds, events, event_timeout=6):
None
"""
events_cp = copy_list(events, deep_copy=False)
for cmd in cmds:
for cmd in cmds:
cmds_items = cmd
if isinstance(cmd, ConnectionObserver):
cmds_items = (cmd,)
try:
event = events_cp.pop(0)
except IndexError:
Expand All @@ -111,6 +114,7 @@ def start_command_after_event(cls, cmds, events, event_timeout=6):
events_after_command = (event,)
for event in events_after_command:
event.start()
cmd.start()
for cmd_item in cmds_items:
cmd_item.start()
for event in events_after_command:
event.await_done(timeout=event_timeout)

0 comments on commit f4cf33c

Please sign in to comment.