Skip to content

Commit 98ba09a

Browse files
committed
FIX : use nested import of traitsui for setup without X
1 parent 597d17c commit 98ba09a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

surfer/viz.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@
2121
from enthought.traits.api import (HasTraits, Range, Int, Float, \
2222
Bool, Enum, on_trait_change)
2323

24-
try:
25-
from traitsui.api import View, Item, VSplit, HSplit, Group
26-
except ImportError:
27-
try:
28-
from traits.ui.api import View, Item, VSplit, HSplit, Group
29-
except ImportError:
30-
from enthought.traits.ui.api import View, Item, VSplit, HSplit, Group
3124

3225
lh_viewdict = {'lateral': {'v': (180., 90.), 'r': 90.},
3326
'medial': {'v': (0., 90.), 'r': -90.},
@@ -1841,6 +1834,15 @@ class TimeViewer(HasTraits):
18411834
""" TimeViewer object providing a GUI for visualizing time series, such
18421835
as M/EEG inverse solutions, on Brain object(s)
18431836
"""
1837+
# Nested import of traisui for setup.py without X server
1838+
try:
1839+
from traitsui.api import View, Item, VSplit, HSplit, Group
1840+
except ImportError:
1841+
try:
1842+
from traits.ui.api import View, Item, VSplit, HSplit, Group
1843+
except ImportError:
1844+
from enthought.traits.ui.api import View, Item, VSplit, HSplit, Group
1845+
18441846
min_time = Int(0)
18451847
max_time = Int(1E9)
18461848
current_time = Range(low="min_time", high="max_time", value=0)

0 commit comments

Comments
 (0)