Skip to content

Commit

Permalink
Update daq_utils.py
Browse files Browse the repository at this point in the history
if no move or viewer instrument is found in a plugin the log info was accessing the index of an empty list, creating an error preventing the instruments to be used...
  • Loading branch information
seb5g committed May 17, 2024
1 parent c7c2517 commit 31dc5dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pymodaq/utils/daq_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,8 @@ def get_instrument_plugins(): # pragma: no cover
'type': 'daq_move'}
for mod in [mod[1] for mod in pkgutil.iter_modules([str(movemodule.path.parent)])]
if 'daq_move' in mod])
if len(plugin_list) > 0:
logger.info(f"Found Move Instrument: {plugin_list[-1]['name']}")
except ModuleNotFoundError:
pass
viewer_modules = {}
Expand All @@ -618,6 +620,8 @@ def get_instrument_plugins(): # pragma: no cover
'type': f'daq_{vtype}viewer'}
for mod in [mod[1] for mod in pkgutil.iter_modules([str(viewer_modules[vtype].path.parent)])]
if f'daq_{vtype}viewer' in mod])
if len(plugin_list) > 0:
logger.info(f"Found Viewer Instrument: {plugin_list[-1]['name']}")
except ModuleNotFoundError:
pass

Expand Down

0 comments on commit 31dc5dc

Please sign in to comment.