<s> """<STR_LIT>""" <EOL> from os . path import dirname <EOL> import logging <EOL> from traits . api import Bool <EOL> from envisage . ui . workbench . api import WorkbenchApplication <EOL> from pyface . api import AboutDialog , ImageResource , SplashScreen <EOL> import mayavi . api <EOL> from mayavi . preferences . api import preference_manager <EOL> IMG_DIR = dirname ( mayavi . api . __file__ ) <EOL> logger = logging . getLogger ( __name__ ) <EOL> class MayaviWorkbenchApplication ( WorkbenchApplication ) : <EOL> """<STR_LIT>""" <EOL> start_gui_event_loop = Bool ( True , desc = '<STR_LIT>' ) <EOL> id = '<STR_LIT>' <EOL> icon = ImageResource ( '<STR_LIT>' , search_path = [ IMG_DIR ] ) <EOL> name = '<STR_LIT>' <EOL> def run ( self ) : <EOL> """<STR_LIT>""" <EOL> logger . debug ( '<STR_LIT>' ) <EOL> gui = self . gui <EOL> if self . start ( ) : <EOL> window = self . workbench . create_window ( <EOL> position = self . window_position , size = self . window_size <EOL> ) <EOL> window . open ( ) <EOL> self . workbench . on_trait_change ( self . _on_workbench_exited , '<STR_LIT>' ) <EOL> if self . start_gui_event_loop : <EOL> gui . start_event_loop ( ) <EOL> return <EOL> def _about_dialog_default ( self ) : <EOL> """<STR_LIT>""" <EOL> from mayavi import api <EOL> from vtk import vtkVersion <EOL> vtk_version = vtkVersion ( ) . GetVTKVersion ( ) <EOL> about_dialog = AboutDialog ( <EOL> parent = self . workbench . active_window . control , <EOL> image = ImageResource ( '<STR_LIT>' , <EOL> search_path = [ IMG_DIR ] ) , <EOL> additions = [ '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' % <EOL> ( api . __version__ , vtk_version ) ] , <EOL> ) <EOL> return about_dialog <EOL> def _splash_screen_default ( self ) : <EOL> """<STR_LIT>""" <EOL> if preference_manager . root . show_splash_screen : <EOL> splash_screen = SplashScreen ( <EOL> image = ImageResource ( '<STR_LIT>' , <EOL> search_path = [ IMG_DIR ] ) , <EOL> show_log_messages = True , <EOL> ) <EOL> else : <EOL> splash_screen = None <EOL> return splash_screen </s>
