Skip to content
Snippets Groups Projects

Resolve "EwoksCore examples refactored"

Merged Wout De Nolf requested to merge 1-ewokscore-examples-refactored into main
14 files
+ 79
21
Compare changes
  • Side-by-side
  • Inline
Files
14
"""Main entry point
python -m ewoksorange.canvas
python -m ewoksorange.canvas --with_example
Which is equivalent too
Which is equivalent to
python -m Orange.canvas
Exists in case we need to register things before launching the canvas
but it registers the example Addon before launching.
"""
@@ -14,12 +14,23 @@ import sys
from Orange.canvas.__main__ import main as _main
def main(**kw):
# Register an addon library with wasn't registered at runtime.
# import orange3unregistered
# from ewoksorange.registration import register_addon_package
# register_addon_package(orange3unregistered, distroname="ewoks_example_addon")
_main(**kw)
def main(argv=None):
if argv is None:
argv = sys.argv
try:
argv.pop(argv.index("--with_example"))
except ValueError:
with_example = False
else:
with_example = True
if with_example:
from ewoksorange.registration import register_addon_package
from ewoksorange.tests.examples import ewoks_example_addon
register_addon_package(ewoks_example_addon)
_main(argv)
if __name__ == "__main__":
Loading