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 13f1f9b commit 224385d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pymodaq/utils/daq_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,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])
logger.info(f"Found Move Instrument: {plugin_list[-1]['name']}")
if len(plugin_list) > 0:
logger.info(f"Found Move Instrument: {plugin_list[-1]['name']}")
except ModuleNotFoundError:
pass

Expand All @@ -598,7 +599,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])
logger.info(f"Found Viewer Instrument: {plugin_list[-1]['name']}")
if len(plugin_list) > 0:
logger.info(f"Found Viewer Instrument: {plugin_list[-1]['name']}")
except ModuleNotFoundError:
pass

Expand Down

0 comments on commit 224385d

Please sign in to comment.