def on_state_changed(self, state):
        """
        Called when the mode is activated/deactivated
        """
        if state:
            self.action.triggered.connect(self.comment)
            self.editor.add_action(self.action, sub_menu='Python')
            if 'pyqt5' in os.environ['QT_API'].lower():
                self.editor.key_pressed.connect(self.on_key_pressed)
        else:
            self.editor.remove_action(self.action, sub_menu='Python')
            self.action.triggered.disconnect(self.comment)
            if 'pyqt5' in os.environ['QT_API'].lower():
                self.editor.key_pressed.disconnect(self.on_key_pressed)
def on_state_changed(self, state):
        """
        Called when the mode is activated/deactivated
        """
        if state:
            self.action.triggered.connect(self.comment)
            self.editor.add_action(self.action, sub_menu='Python')
            if 'pyqt5' in os.environ['QT_API'].lower():
                self.editor.key_pressed.connect(self.on_key_pressed)
        else:
            self.editor.remove_action(self.action, sub_menu='Python')
            self.action.triggered.disconnect(self.comment)
            if 'pyqt5' in os.environ['QT_API'].lower():
                self.editor.key_pressed.disconnect(self.on_key_pressed)
def on_state_changed ( self , state ) : if state : self . action . triggered . connect ( self . comment ) self . editor . add_action ( self . action , sub_menu = 'Python' ) if 'pyqt5' in os . environ [ 'QT_API' ] . lower ( ) : self . editor . key_pressed . connect ( self . on_key_pressed ) else : self . editor . remove_action ( self . action , sub_menu = 'Python' ) self . action . triggered . disconnect ( self . comment ) if 'pyqt5' in os . environ [ 'QT_API' ] . lower ( ) : self . editor . key_pressed . disconnect ( self . on_key_pressed )
Called when the mode is activated/deactivated
Called when the mode is activated / deactivated