#NEWLINE# def insert_action( self , action , prev_action ) : #NEWLINE# #INDENT# "\n        Inserts an action to the editor's context menu.\n\n        :param action: action to insert\n        :param prev_action: the action after which the new action must be\n            inserted or the insert index\n        " #NEWLINE# if isinstance ( prev_action , QtWidgets . QAction ) : #NEWLINE# #INDENT# index = self . _actions . index ( prev_action ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# index = prev_action #NEWLINE# #UNINDENT# action . setShortcutContext ( QtCore . Qt . WidgetShortcut ) #NEWLINE# self . _actions . insert ( index , action )