#NEWLINE# @ staticmethod #NEWLINE# def enable_check( method = 'view' , external = False ) : #NEWLINE# #INDENT# 'Enable check.' #NEWLINE# allow = bool ( load_settings ( ) . get ( 'last_activated_commands' , True ) ) #NEWLINE# enabled = False #NEWLINE# if ( method == 'view' ) : #NEWLINE# #INDENT# enabled = ( allow and bool ( ( EasyDiffListener . current and EasyDiffListener . last ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( method == 'selection' ) : #NEWLINE# #INDENT# enabled = ( allow and bool ( load_settings ( ) . get ( 'use_selections' , True ) ) and bool ( ( EasyDiffListener . current and EasyDiffListener . last ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( method == 'clipboard' ) : #NEWLINE# #INDENT# enabled = ( allow and bool ( load_settings ( ) . get ( 'use_clipboard' , True ) ) and bool ( EasyDiffListener . last ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( method == 'clipboard_selection' ) : #NEWLINE# #INDENT# enabled = ( allow and bool ( load_settings ( ) . get ( 'use_clipboard' , True ) ) and bool ( load_settings ( ) . get ( 'use_selections' , True ) ) and bool ( EasyDiffListener . last ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if external : #NEWLINE# #INDENT# enabled = ( enabled and bool ( load_settings ( ) . get ( 'show_external' , True ) ) and ( get_external_diff ( ) is not None ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# enabled = ( enabled and bool ( load_settings ( ) . get ( 'show_internal' , True ) ) ) #NEWLINE# #UNINDENT# return enabled