Skip to content

STYLE: Update python scripts to not import from __main__

Created by: jcfr

This commit simplifies the scripts removing extra from __main__ statements and improve the integration with Python IDE ensuring python package like slicer can simply be imported.

The from __main__ statement most likely became obsolete since r24155 (ENH: Fixes #3549. Import scripted module as python module).

Remarks:

A global replace of from __main__ import into import as been done except in:

  • EditOptions: from __main__ getNodes changed into from slicer.util import getNodes
  • slicer/module[dm|logic|mrml|widget]/init.py where it makes sense to keep it.

Merge request reports