Skip to content
Snippets Groups Projects
Commit 57f5af6c authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Missed alternate usage of fslDirWarning

parent 36222973
No related branches found
No related tags found
No related merge requests found
......@@ -321,6 +321,14 @@ def fslDirWarning(toolName, fslEnvActive):
if fslEnvActive: return
haveGui = False
try:
import wx
if wx.GetApp() is not None:
haveGui = True
except:
pass
warnmsg = 'The FSLDIR environment variable is not set - '\
'{} may not behave correctly.'.format(toolName)
......@@ -332,7 +340,7 @@ def fslDirWarning(toolName, fslEnvActive):
os.environ['FSLDIR'] = fsldir
return
if fsldir is None:
if haveGui:
import wx
from fsl.utils.fsldirdlg import FSLDirDialog
......@@ -461,5 +469,5 @@ def main(args=None):
if fslTool.context is not None: ctx = fslTool.context(toolArgs)
else: ctx = None
fslDirWarning( None, fslTool.toolName, fslEnvActive)
fslDirWarning(fslTool.toolName, fslEnvActive)
fslTool.execute(toolArgs, ctx)
......@@ -17,7 +17,7 @@ def read(name, default=None):
if wx.GetApp() is None:
return None
config = wx.Config('fsleyes')
config = wx.Config('uk.ac.ox.fmrib.fslpy')
value = config.Read(name)
......@@ -37,7 +37,7 @@ def write(name, value):
return
value = str(value)
config = wx.Config('fsleyes')
config = wx.Config('uk.ac.ox.fmrib.fslpy')
log.debug('Writing {}: {}'.format(name, value))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment