napari_track_edit.__main__

Attributes

LOG_FORMAT

Functions

_configure_logging(→ None)

Send napari_track_edit's log records to the console.

_activate_on_macos(→ None)

Force the napari window (and its menu bar) to take focus on macOS.

main()

Module Contents

napari_track_edit.__main__.LOG_FORMAT = '%(asctime)s [%(filename)s:%(lineno)d] %(levelname)-8s %(message)s'
napari_track_edit.__main__._configure_logging() → None

Send napari_track_edit’s log records to the console.

Configures our own package logger rather than the root logger, so napari, vispy and the rest of the dependency tree keep their own levels.

Called from main(), not from an if __name__ == "__main__" block: the installed napari-track-edit command imports this module and calls main(), so such a block only runs for python -m napari_track_edit.

napari_track_edit.__main__._activate_on_macos(viewer: napari.Viewer) → None

Force the napari window (and its menu bar) to take focus on macOS.

When napari is launched as a subprocess of another app (e.g. VS Code’s integrated terminal), the OS sometimes leaves the parent app’s menu bar in place even though napari’s window is frontmost. Explicitly raising and activating the window nudges macOS into handing over the menu bar.

napari_track_edit.__main__.main()