<s> """<STR_LIT>""" <EOL> from os import path <EOL> import os <EOL> import sys <EOL> from os . path import join , dirname <EOL> from pyface . action . api import Action <EOL> from traitsui . api import auto_close_message <EOL> import mayavi . api <EOL> from mayavi . core . common import error <EOL> from mayavi . preferences . api import preference_manager <EOL> local_dir = dirname ( mayavi . api . __file__ ) <EOL> HTML_DIR = join ( local_dir , '<STR_LIT:html>' ) <EOL> if not path . exists ( HTML_DIR ) : <EOL> HTML_DIR = join ( dirname ( dirname ( local_dir ) ) , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:html>' , '<STR_LIT>' ) <EOL> if not path . exists ( HTML_DIR ) : <EOL> HTML_DIR = None <EOL> def browser_open ( url ) : <EOL> if sys . platform == '<STR_LIT>' : <EOL> os . system ( '<STR_LIT>' % url ) <EOL> else : <EOL> import webbrowser <EOL> if webbrowser . _iscommand ( '<STR_LIT>' ) and preference_manager . root . open_help_in_light_browser : <EOL> firefox = webbrowser . get ( '<STR_LIT>' ) <EOL> firefox . _invoke ( [ '<STR_LIT>' , url ] , remote = False , autoraise = True ) <EOL> else : <EOL> webbrowser . open ( url , autoraise = <NUM_LIT:1> ) <EOL> def open_help_index ( ) : <EOL> """<STR_LIT>""" <EOL> if HTML_DIR : <EOL> auto_close_message ( "<STR_LIT>" ) <EOL> browser_open ( join ( HTML_DIR , '<STR_LIT>' ) ) <EOL> else : <EOL> error ( "<STR_LIT>" "<STR_LIT>" ) <EOL> def open_tvtk_docs ( ) : <EOL> """<STR_LIT>""" <EOL> from tvtk . tools . tvtk_doc import TVTKClassChooser <EOL> TVTKClassChooser ( ) . edit_traits ( ) <EOL> class HelpIndex ( Action ) : <EOL> """<STR_LIT>""" <EOL> tooltip = "<STR_LIT>" <EOL> description = "<STR_LIT>" <EOL> def perform ( self , event ) : <EOL> """<STR_LIT>""" <EOL> open_help_index ( ) <EOL> class TVTKClassBrowser ( Action ) : <EOL> """<STR_LIT>""" <EOL> tooltip = "<STR_LIT>" <EOL> description = "<STR_LIT>" <EOL> def perform ( self , event ) : <EOL> """<STR_LIT>""" <EOL> open_tvtk_docs ( ) </s>
