#NEWLINE# def start_plugin_future( self , chname , opname , future , alreadyOpenOk = True ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# pInfo = self . getPluginInfo ( opname ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# self . fv . show_error ( ( "No plugin information for plugin '%s'" % opname ) ) #NEWLINE# return #NEWLINE# #UNINDENT# if ( chname is not None ) : #NEWLINE# #INDENT# plname = ( ( chname . upper ( ) + ': ' ) + pInfo . name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# plname = pInfo . name #NEWLINE# #UNINDENT# lname = pInfo . name . lower ( ) #NEWLINE# if ( lname in self . active ) : #NEWLINE# #INDENT# if alreadyOpenOk : #NEWLINE# #INDENT# self . set_focus ( pInfo . name ) #NEWLINE# return #NEWLINE# #UNINDENT# raise PluginManagerError ( ( 'Plugin %s is already active.' % plname ) ) #NEWLINE# #UNINDENT# pInfo . tabname = pInfo . spec . get ( 'tab' , plname ) #NEWLINE# vbox = None #NEWLINE# had_error = False #NEWLINE# try : #NEWLINE# #INDENT# if hasattr ( pInfo . obj , 'build_gui' ) : #NEWLINE# #INDENT# vbox = Widgets . VBox ( ) #NEWLINE# in_ws = pInfo . spec . ws #NEWLINE# if in_ws . startswith ( 'in:' ) : #NEWLINE# #INDENT# vbox . size = ( 400 , 900 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( wd , ht ) = self . ds . get_ws_size ( in_ws ) #NEWLINE# vbox . size = ( wd , ht ) #NEWLINE# #UNINDENT# if future : #NEWLINE# #INDENT# pInfo . obj . build_gui ( vbox , future = future ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# pInfo . obj . build_gui ( vbox ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# errstr = ( 'Plugin UI failed to initialize: %s' % str ( e ) ) #NEWLINE# self . logger . error ( errstr ) #NEWLINE# try : #NEWLINE# #INDENT# ( type , value , tb ) = sys . exc_info ( ) #NEWLINE# tb_str = '' . join ( traceback . format_tb ( tb ) ) #NEWLINE# self . logger . error ( ( 'Traceback:\n%s' % tb_str ) ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# tb_str = 'Traceback information unavailable.' #NEWLINE# self . logger . error ( tb_str ) #NEWLINE# #UNINDENT# self . plugin_build_error ( vbox , ( ( lname + '\n' ) + tb_str ) ) #NEWLINE# #UNINDENT# if ( not had_error ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# if future : #NEWLINE# #INDENT# pInfo . obj . start ( future = future ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# pInfo . obj . start ( ) #NEWLINE# #UNINDENT# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# had_error = True #NEWLINE# errstr = ( 'Plugin failed to start correctly: %s' % str ( e ) ) #NEWLINE# self . logger . error ( errstr ) #NEWLINE# try : #NEWLINE# #INDENT# ( type , value , tb ) = sys . exc_info ( ) #NEWLINE# tb_str = '' . join ( traceback . format_tb ( tb ) ) #NEWLINE# self . logger . error ( ( 'Traceback:\n%s' % tb_str ) ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# tb_str = 'Traceback information unavailable.' #NEWLINE# self . logger . error ( tb_str ) #NEWLINE# #UNINDENT# self . plugin_build_error ( vbox , ( ( errstr + '\n' ) + tb_str ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( vbox is not None ) : #NEWLINE# #INDENT# self . finish_gui ( pInfo , vbox ) #NEWLINE# self . activate ( pInfo ) #NEWLINE# self . set_focus ( pInfo . name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( pInfo . chinfo is not None ) : #NEWLINE# #INDENT# itab = pInfo . chinfo . name #NEWLINE# self . ds . raise_tab ( itab )