Skip to content
Snippets Groups Projects
Commit 710070f7 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Add imagej.misc.error_exit()

parent b65c5634
No related branches found
No related tags found
No related merge requests found
"""Miscellaneous ImageJ related functions, mostly convenience wrappers.""" """Miscellaneous ImageJ related functions, mostly convenience wrappers."""
import sys
from ij import IJ # pylint: disable-msg=E0401 from ij import IJ # pylint: disable-msg=E0401
from ..log import LOG as log from ..log import LOG as log
def show_status(msg): def show_status(msg):
"""Wrapper to update the ImageJ status bar and the log simultaneously.""" """Wrapper to update the ImageJ status bar and the log simultaneously."""
log.info(msg) log.info(msg)
...@@ -15,3 +17,8 @@ def show_progress(cur, final): ...@@ -15,3 +17,8 @@ def show_progress(cur, final):
# ij.IJ.showProgress is adding 1 to the value given as first parameter... # ij.IJ.showProgress is adding 1 to the value given as first parameter...
log.info("Progress: %s / %s (%s)", cur+1, final, (1.0+cur)/final) log.info("Progress: %s / %s (%s)", cur+1, final, (1.0+cur)/final)
IJ.showProgress(cur, final) IJ.showProgress(cur, final)
def error_exit(msg):
"""Convenience wrapper to log an error and exit then."""
log.error(msg)
sys.exit(msg)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment