#NEWLINE# def run_shell_command( self , command = None , stdin = None , panel = False , target = None , title = None , syntax = None , refresh = False , console = None , working_dir = None , wait_for_completion = None , root_dir = False ) : #NEWLINE# #INDENT# ( view , window ) = self . get_view_and_window ( ) #NEWLINE# settings = sublime . load_settings ( 'ShellCommand.sublime-settings' ) #NEWLINE# if ( command is None ) : #NEWLINE# #INDENT# sublime . message_dialog ( 'No command provided.' ) #NEWLINE# return #NEWLINE# #UNINDENT# if ( working_dir is None ) : #NEWLINE# #INDENT# working_dir = self . get_working_dir ( root_dir = root_dir ) #NEWLINE# #UNINDENT# message = ( ( ( self . default_prompt + ': (' ) + '' . join ( command ) [ : 20 ] ) + ')' ) #NEWLINE# self . finished = False #NEWLINE# self . output_target = None #NEWLINE# self . output_written = False #NEWLINE# self . progress = SH . ProgressDisplay ( view , message , message , settings . get ( 'progress_display_heartbeat' ) ) #NEWLINE# self . progress . start ( ) #NEWLINE# scroll_show_maximum_output = settings . get ( 'comint-scroll-show-maximum-output' ) #NEWLINE# def _C2( output ) : #NEWLINE# #INDENT# if ( output is None ) : #NEWLINE# #INDENT# self . finished = True #NEWLINE# if ( self . output_written is False ) : #NEWLINE# #INDENT# show_message = settings . get ( 'show_success_but_no_output_message' ) #NEWLINE# if show_message : #NEWLINE# #INDENT# output = settings . get ( 'success_but_no_output_message' ) #NEWLINE# #UNINDENT# #UNINDENT# if ( refresh is True ) : #NEWLINE# #INDENT# view . run_command ( 'shell_command_refresh' ) #NEWLINE# #UNINDENT# self . progress . stop ( ) #NEWLINE# #UNINDENT# if ( output is not None ) : #NEWLINE# #INDENT# if ( ( self . output_written is True ) or ( len ( output . strip ( ) ) > 0 ) ) : #NEWLINE# #INDENT# if ( self . output_target is None ) : #NEWLINE# #INDENT# self . output_target = SH . OutputTarget ( window , self . data_key , command , working_dir , title = title , syntax = syntax , panel = panel , console = console , target = target ) #NEWLINE# if ( self . finished is False ) : #NEWLINE# #INDENT# self . progress . stop ( ) #NEWLINE# self . progress = SH . ProgressDisplay ( self . output_target , message , message , settings . get ( 'progress_display_heartbeat' ) ) #NEWLINE# self . progress . start ( ) #NEWLINE# #UNINDENT# #UNINDENT# self . output_target . append_text ( output , scroll_show_maximum_output = scroll_show_maximum_output ) #NEWLINE# self . output_written = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return self . run_shell_command_raw ( command , _C2 , stdin = stdin , settings = working_dir , working_dir = working_dir , wait_for_completion = wait_for_completion , root_dir = root_dir )