Skip to content

Commit

Permalink
new log function to work on any platform
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferis committed Apr 16, 2015
1 parent 074d716 commit a0c5d66
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmtkgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

is_jython = platform.system()=="Java"

if(is_jython):
import java.io.File

gui_tarball_url='https://github.com/jefferis/fiji-cmtk-gui/tarball/master'

def myExit(err):
Expand All @@ -20,6 +23,17 @@ def myErr(err):
IJ.error(err)
myExit(err)

def log(msg):
'''
logger that chooses simple prints or ImageJ log as appropriate
'''
if is_jython:
from ij import IJ
if IJ.debugMode:
IJ.log(msg)
else:
print(msg)

def which(execname):
'''
run system which command to locate an executable
Expand Down

0 comments on commit a0c5d66

Please sign in to comment.