Skip to content

Commit

Permalink
better info on plugin discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
seb5g committed May 17, 2024
1 parent 072ac1c commit 94a79b4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
26 changes: 15 additions & 11 deletions src/pymodaq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def check_qt_presence():
logger.info('')
logger.info('************************')
logger.info(f"Setting Qt backend to: {config['qtbackend']['backend']} ...")
logger.info('************************')
set_qt_backend()
logger.info('************************')
logger.info('')
logger.info('')
logger.info('************************')
Expand All @@ -84,41 +84,45 @@ def check_qt_presence():
Q_ = ureg.Quantity
logger.info('')
logger.info('')
logger.info('************************')
logger.info('*************************************************************************')
logger.info(f"Getting the list of instrument plugins...")
logger.info('************************')

logger.info('')
get_instrument_plugins()
logger.info('*************************************************************************')

if config('network', 'leco-server', 'run_coordinator_at_startup'):
try:
from pymodaq.utils.leco.utils import start_coordinator
logger.info('')
logger.info('')
logger.info('************************')
logger.info(f'********************************')
logger.info(f"Starting the LECO Coordinator...")
logger.info('************************')
logger.info('')
logger.info('')
start_coordinator()
logger.info(f"Done")
except ImportError as e:
logger.warning(f'Issue while importing the pyleco package: {str(e)}')
except Exception as e:
logger.warning(f'Issue while starting the pyleco coordinator: {str(e)}')
finally:
logger.info('************************')
logger.info('')
logger.info('')

logger.info('')
logger.info('')
logger.info('************************')
logger.info(f"Registering Scanners...")
logger.info('************************')
register_scanners()
logger.info(f"Done")
logger.info('************************')

logger.info('')
logger.info('')
logger.info('************************')
logger.info(f"Registering plotters...")
logger.info('************************')
register_plotter()

logger.info(f"Done")
logger.info('************************')

except Exception as e:
try:
Expand Down
6 changes: 4 additions & 2 deletions src/pymodaq/utils/daq_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,8 @@ def get_instrument_plugins(): # pragma: no cover
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']}")
logger.info(f"Found Move Instrument:"
f" {plugin_list[-1]['module'].__name__}/{plugin_list[-1]['name']}")
except ModuleNotFoundError:
pass

Expand All @@ -600,7 +601,8 @@ def get_instrument_plugins(): # pragma: no cover
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']}")
logger.info(f"Found Viewer Instrument: "
f"{plugin_list[-1]['module'].__name__}/{plugin_list[-1]['name']}")
except ModuleNotFoundError:
pass

Expand Down

0 comments on commit 94a79b4

Please sign in to comment.