#NEWLINE# def startup( self ) : #NEWLINE# #INDENT# cache_dir = self . env . cache_dir #NEWLINE# port_file = path . join ( cache_dir , 'port' ) #NEWLINE# http_port_file = path . join ( cache_dir , 'http' ) #NEWLINE# try : #NEWLINE# #INDENT# if ( not self . env . running ) : #NEWLINE# #INDENT# if self . env . settings . get ( 'connect_to_external_server' , False ) : #NEWLINE# #INDENT# self . port_file = port_file #NEWLINE# self . http_port_file = http_port_file #NEWLINE# if ( not self . port_file ) : #NEWLINE# #INDENT# message = '"connect_to_external_server" in your Ensime.sublime-settings is set to true, ' #NEWLINE# message += 'however "external_server_port_file" is not specified. ' #NEWLINE# message += 'Set it to a meaningful value and restart Ensime.' #NEWLINE# self . logger . error ( message ) #NEWLINE# sublime . set_timeout ( bind ( sublime . error_message , message ) , 0 ) #NEWLINE# return #NEWLINE# #UNINDENT# if ( not os . path . exists ( self . port_file ) ) : #NEWLINE# #INDENT# message = '"connect_to_external_server" in your Ensime.sublime-settings is set to true, ' #NEWLINE# message += 'however "external_server_port_file" is set to a non-existent file "' #NEWLINE# message += ( self . port_file + '" . ' ) #NEWLINE# message += 'Check the configuration and restart Ensime.' #NEWLINE# self . logger . error ( message ) #NEWLINE# sublime . set_timeout ( bind ( sublime . error_message , message ) , 0 ) #NEWLINE# return #NEWLINE# #UNINDENT# self . server = None #NEWLINE# self . env . running = True #NEWLINE# sublime . set_timeout ( self . ignition , 0 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . port_file = port_file #NEWLINE# self . http_port_file = http_port_file #NEWLINE# self . server = Server ( self . owner , port_file ) #NEWLINE# self . server . startup ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# self . env . running = False #NEWLINE# raise