Esempio n. 1
0
 def __init__(self):
     QtCore.QObject.__init__(self)
     Mode.__init__(self)
     self._previous_cursor_start = -1
     self._previous_cursor_end = -1
     self._deco = None
     self._cursor = None
     self._timer = DelayJobRunner(delay=200)
 def on_install(self, editor):
     self._completer = QtWidgets.QCompleter([""], editor)
     self._completer.setCompletionMode(self._completer.PopupCompletion)
     self._completer.activated.connect(self._insert_completion)
     self._completer.highlighted.connect(
         self._on_selected_completion_changed)
     self._completer.setModel(QtGui.QStandardItemModel())
     self._helper = TextHelper(editor)
     Mode.on_install(self, editor)
Esempio n. 3
0
 def __init__(self):
     Mode.__init__(self)
     QtWidgets.QWidget.__init__(self)
     #: Panel order into the zone it is installed to. This value is
     #: automatically set when installing the panel but it can be changed
     #: later (negative values can also be used).
     self.order_in_zone = -1
     self._scrollable = False
     self._background_brush = None
     self._foreground_pen = None
     #: Position in the editor (top, left, right, bottom)
     self.position = -1
 def __init__(self):
     QtCore.QObject.__init__(self)
     Mode.__init__(self)
     self._auto_reload = False
     self._flg_notify = False
     self._data = (None, None)
     self._timer = QtCore.QTimer()
     self._timer.setInterval(1000)
     self._timer.timeout.connect(self._check_mtime)
     self._mtime = 0
     self._notification_pending = False
     self._processing = False
 def __init__(self):
     QtCore.QObject.__init__(self)
     Mode.__init__(self)
     self._auto_reload = False
     self._flg_notify = False
     self._data = (None, None)
     self._timer = QtCore.QTimer()
     self._timer.setInterval(1000)
     self._timer.timeout.connect(self._check_mtime)
     self._mtime = 0
     self._notification_pending = False
     self._processing = False
Esempio n. 6
0
 def __init__(self):
     Mode.__init__(self)
     QtCore.QObject.__init__(self)
     self._current_completion = ""
     self._trigger_key = QtCore.Qt.Key_Space
     self._trigger_len = 1
     self._trigger_symbols = ['.']
     self._case_sensitive = True
     self._completer = None
     self._filter_mode = self.FILTER_PREFIX
     self._last_cursor_line = -1
     self._last_cursor_column = -1
     self._tooltips = {}
     self._show_tooltips = False
     self._request_id = self._last_request_id = 0
 def __init__(self):
     Mode.__init__(self)
     QtCore.QObject.__init__(self)
     self._current_completion = ""
     self._trigger_key = QtCore.Qt.Key_Space
     self._trigger_len = 1
     self._trigger_symbols = ['.']
     self._case_sensitive = False
     self._completer = None
     self._filter_mode = self.FILTER_FUZZY
     self._last_cursor_line = -1
     self._last_cursor_column = -1
     self._tooltips = {}
     self._show_tooltips = False
     self._request_id = self._last_request_id = 0
 def __init__(self, parent, color_scheme=None):
     """
     :param parent: parent document (QTextDocument)
     :param color_scheme: color scheme to use.
     """
     QtGui.QSyntaxHighlighter.__init__(self, parent)
     Mode.__init__(self)
     if not color_scheme:
         color_scheme = ColorScheme('qt')
     self._color_scheme = color_scheme
     self._spaces_ptrn = QtCore.QRegExp(r'[ \t]+')
     #: Fold detector. Set it to a valid FoldDetector to get code folding
     #: to work. Default is None
     self.fold_detector = None
     self.WHITESPACES = QtCore.QRegExp(r'\s+')
 def __init__(self, parent, color_scheme=None):
     """
     :param parent: parent document (QTextDocument)
     :param color_scheme: color scheme to use.
     """
     QtGui.QSyntaxHighlighter.__init__(self, parent)
     Mode.__init__(self)
     if not color_scheme:
         color_scheme = ColorScheme('qt')
     self._color_scheme = color_scheme
     self._spaces_ptrn = QtCore.QRegExp(r'[ \t]+')
     #: Fold detector. Set it to a valid FoldDetector to get code folding
     #: to work. Default is None
     self.fold_detector = None
     self.WHITESPACES = QtCore.QRegExp(r'\s+')
Esempio n. 10
0
 def __init__(self, dynamic=False):
     Mode.__init__(self)
     QtWidgets.QWidget.__init__(self)
     #: Specifies whether the panel is dynamic. A dynamic panel is a panel
     #: that will be shown/hidden depending on the context.
     #: Dynamic panel should not appear in any GUI menu (e.g. no display
     #: in the panels menu of the notepad example).
     self.dynamic = dynamic
     #: Panel order into the zone it is installed to. This value is
     #: automatically set when installing the panel but it can be changed
     #: later (negative values can also be used).
     self.order_in_zone = -1
     self._scrollable = False
     self._background_brush = None
     self._foreground_pen = None
     #: Position in the editor (top, left, right, bottom)
     self.position = -1
Esempio n. 11
0
 def __init__(self, dynamic=False):
     Mode.__init__(self)
     QtWidgets.QWidget.__init__(self)
     #: Specifies whether the panel is dynamic. A dynamic panel is a panel
     #: that will be shown/hidden depending on the context.
     #: Dynamic panel should not appear in any GUI menu (e.g. no display
     #: in the panels menu of the notepad example).
     self.dynamic = dynamic
     #: Panel order into the zone it is installed to. This value is
     #: automatically set when installing the panel but it can be changed
     #: later (negative values can also be used).
     self.order_in_zone = -1
     self._scrollable = False
     self._background_brush = None
     self._foreground_pen = None
     #: Position in the editor (top, left, right, bottom)
     self.position = -1
Esempio n. 12
0
    def on_install(self, editor):
        """
        Extends :meth:`pyqode.core.api.Mode.on_install` method to set the
        editor instance as the parent widget.

        .. warning:: Don't forget to call **super** if you override this
            method!

        :param editor: editor instance
        :type editor: pyqode.core.api.CodeEdit
        """
        Mode.on_install(self, editor)
        self.setParent(editor)
        self.setPalette(QtWidgets.QApplication.instance().palette())
        self.setFont(QtWidgets.QApplication.instance().font())
        self.editor.panels.refresh()
        self._background_brush = QtGui.QBrush(QtGui.QColor(
            self.palette().window().color()))
        self._foreground_pen = QtGui.QPen(QtGui.QColor(
            self.palette().windowText().color()))
Esempio n. 13
0
 def __init__(self, worker, delay=500, show_tooltip=True):
     """
     :param worker: The process function or class to call remotely.
     :param delay: The delay used before running the analysis process when
                   trigger is set to
                   :class:pyqode.core.modes.CheckerTriggers`
     :param show_tooltip: Specify if a tooltip must be displayed when the
                          mouse is over a checker message decoration.
     """
     Mode.__init__(self)
     QtCore.QObject.__init__(self)
     # max number of messages to keep good performances
     self.limit = 200
     self._job_runner = DelayJobRunner(delay=delay)
     self._messages = []
     self._worker = worker
     self._mutex = QtCore.QMutex()
     self._show_tooltip = show_tooltip
     self._pending_msg = []
     self._finished = True
Esempio n. 14
0
    def on_install(self, editor):
        """
        Extends :meth:`pyqode.core.api.Mode.on_install` method to set the
        editor instance as the parent widget.

        .. warning:: Don't forget to call **super** if you override this
            method!

        :param editor: editor instance
        :type editor: pyqode.core.api.CodeEdit
        """
        Mode.on_install(self, editor)
        self.setParent(editor)
        self.setPalette(QtWidgets.QApplication.instance().palette())
        self.setFont(QtWidgets.QApplication.instance().font())
        self.editor.panels.refresh()
        self._background_brush = QtGui.QBrush(
            QtGui.QColor(self.palette().window().color()))
        self._foreground_pen = QtGui.QPen(
            QtGui.QColor(self.palette().windowText().color()))
Esempio n. 15
0
 def __init__(self):
     Mode.__init__(self)
     QtCore.QObject.__init__(self)
     self._current_completion = ""
     # use to display a waiting cursor if completion provider takes too much
     # time
     self._job_runner = DelayJobRunner(delay=1000)
     self._tooltips = {}
     self._cursor_line = -1
     self._cancel_next = False
     self._request_cnt = 0
     self._last_completion_prefix = ""
     self._trigger_key = None
     self._trigger_len = None
     self._trigger_symbols = None
     self._show_tooltips = None
     self._case_sensitive = None
     self._data = None
     self._completer = None
     self._col = 0
     self._skip_next_backspace_released = False
     self._init_settings()
 def __init__(self):
     Mode.__init__(self)
     QtCore.QObject.__init__(self)
     self._current_completion = ""
     # use to display a waiting cursor if completion provider takes too much
     # time
     self._job_runner = DelayJobRunner(delay=1000)
     self._tooltips = {}
     self._cursor_line = -1
     self._cancel_next = False
     self._request_cnt = 0
     self._last_completion_prefix = ""
     self._trigger_key = None
     self._trigger_len = None
     self._trigger_symbols = None
     self._show_tooltips = None
     self._case_sensitive = None
     self._data = None
     self._completer = None
     self._col = 0
     self._skip_next_backspace_released = False
     self._init_settings()
Esempio n. 17
0
 def __init__(self, worker,
              delay=500,
              show_tooltip=True):
     """
     :param worker: The process function or class to call remotely.
     :param delay: The delay used before running the analysis process when
                   trigger is set to
                   :class:pyqode.core.modes.CheckerTriggers`
     :param show_tooltip: Specify if a tooltip must be displayed when the
                          mouse is over a checker message decoration.
     """
     Mode.__init__(self)
     QtCore.QObject.__init__(self)
     # max number of messages to keep good performances
     self.limit = 200
     self._job_runner = DelayJobRunner(delay=delay)
     self._messages = []
     self._worker = worker
     self._mutex = QtCore.QMutex()
     self._show_tooltip = show_tooltip
     self._pending_msg = []
     self._finished = True
Esempio n. 18
0
 def on_uninstall(self):
     Mode.on_uninstall(self)
     self._completer.popup().hide()
     self._completer = None
Esempio n. 19
0
 def on_install(self, editor):
     self._create_completer()
     self._completer.setModel(QtGui.QStandardItemModel())
     self._helper = TextHelper(editor)
     Mode.on_install(self, editor)
Esempio n. 20
0
 def __init__(self):
     Mode.__init__(self)
     self._actions_created = False
     self.action_to_lower = None
     self.action_to_upper = None
Esempio n. 21
0
 def on_uninstall(self):
     Mode.on_uninstall(self)
     self._completer.popup().hide()
     self._completer = None
Esempio n. 22
0
 def on_install(self, editor):
     self._create_completer()
     self._completer.setModel(QtWidgets.QStandardItemModel())
     self._helper = TextHelper(editor)
     Mode.on_install(self, editor)