pyqt-code-editor 0.0.44__tar.gz → 0.0.46__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/PKG-INFO +1 -1
  2. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/__init__.py +1 -1
  3. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/base.py +7 -2
  4. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/file_link.py +7 -1
  5. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/widgets/tabbed_editor.py +12 -9
  6. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/COPYING +0 -0
  7. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyproject.toml +0 -0
  8. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/_settings.py +0 -0
  9. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/app.py +0 -0
  10. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/code_editors/__init__.py +0 -0
  11. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/code_editors/code_editors.py +0 -0
  12. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/code_editors/languages/__init__.py +0 -0
  13. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/code_editors/languages/generic.py +0 -0
  14. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/code_editors/languages/javascript.py +0 -0
  15. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/code_editors/languages/markdown.py +0 -0
  16. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/code_editors/languages/python.py +0 -0
  17. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/code_editors/languages/text.py +0 -0
  18. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/components/__init__.py +0 -0
  19. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/components/editor_panel.py +0 -0
  20. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/components/find_in_files.py +0 -0
  21. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/components/jupyter_console.py +0 -0
  22. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/components/project_explorer.py +0 -0
  23. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/components/settings_panel.py +0 -0
  24. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/components/sigmund.py +0 -0
  25. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/components/workspace_explorer.py +0 -0
  26. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/environment_manager.py +0 -0
  27. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/__init__.py +0 -0
  28. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/auto_indent.py +0 -0
  29. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/auto_pair.py +0 -0
  30. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/check.py +0 -0
  31. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/comment.py +0 -0
  32. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/complete.py +0 -0
  33. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/execute.py +0 -0
  34. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/line_number.py +0 -0
  35. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/python_auto_indent.py +0 -0
  36. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/search_replace.py +0 -0
  37. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/shortcuts.py +0 -0
  38. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/smart_backspace_delete.py +0 -0
  39. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/symbols.py +0 -0
  40. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/theme.py +0 -0
  41. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/widgets/__init__.py +0 -0
  42. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/mixins/zoom.py +0 -0
  43. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/sigmund-analyst.png +0 -0
  44. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/signal_router.py +0 -0
  45. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/syntax_highlighters/__init__.py +0 -0
  46. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/syntax_highlighters/languages/__init__.py +0 -0
  47. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/syntax_highlighters/languages/generic.py +0 -0
  48. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/syntax_highlighters/languages/python.py +0 -0
  49. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/syntax_highlighters/syntax_highlighter.py +0 -0
  50. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/themes.py +0 -0
  51. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/utils/__init__.py +0 -0
  52. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/utils/languages/__init__.py +0 -0
  53. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/utils/languages/python/__init__.py +0 -0
  54. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/utils/languages/python/_auto_indent.py +0 -0
  55. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/utils/languages/python/_extract_cells.py +0 -0
  56. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/utils/languages/python/_mask_str_in_code.py +0 -0
  57. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/watchdog.py +0 -0
  58. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/widgets/__init__.py +0 -0
  59. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/widgets/calltip_widget.py +0 -0
  60. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/widgets/completion_popup.py +0 -0
  61. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/widgets/dock.py +0 -0
  62. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/widgets/quick_open_dialog.py +0 -0
  63. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/widgets/quick_open_file_dialog.py +0 -0
  64. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/widgets/quick_symbol_dialog.py +0 -0
  65. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/widgets/search_replace_frame.py +0 -0
  66. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/widgets/tab_splitter.py +0 -0
  67. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/worker/__init__.py +0 -0
  68. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/worker/languages/__init__.py +0 -0
  69. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/worker/languages/generic.py +0 -0
  70. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/worker/languages/python.py +0 -0
  71. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/worker/manager.py +0 -0
  72. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/worker/process.py +0 -0
  73. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/worker/providers/__init__.py +0 -0
  74. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/worker/providers/codestral.py +0 -0
  75. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/worker/providers/jedi.py +0 -0
  76. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/worker/providers/ruff.py +0 -0
  77. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/worker/providers/sigmund.py +0 -0
  78. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/worker/providers/symbol.py +0 -0
  79. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/pyqt_code_editor/worker/settings.py +0 -0
  80. {pyqt_code_editor-0.0.44 → pyqt_code_editor-0.0.46}/readme.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqt_code_editor
3
- Version: 0.0.44
3
+ Version: 0.0.46
4
4
  Summary: Fully featured code-editor widgets for PyQt
5
5
  Keywords: code editor,pyqt,ide
6
6
  Author-email: Sebastiaan Mathôt <s.mathot@cogsci.nl>
@@ -2,4 +2,4 @@
2
2
 
3
3
  from ._settings import settings
4
4
 
5
- __version__ = '0.0.44'
5
+ __version__ = '0.0.46'
@@ -38,10 +38,15 @@ class Base:
38
38
  self.modified = False
39
39
  self.modificationChanged.connect(self.set_modified)
40
40
  # Dictionary mapping pid -> result queue
41
- self._active_requests = {}
41
+ self._active_requests = {}
42
+
43
+ def unload(self):
44
+ """Can be implemented in other mixin classes to handle unloading logic.
45
+ """
46
+ pass
42
47
 
43
48
  def eventFilter(self, obj, event):
44
- """Can be implement in other mixin classes to filter certain events,
49
+ """Can be implemented in other mixin classes to filter certain events,
45
50
  for example to avoid certain keypresses from being consumed.
46
51
  """
47
52
  return False
@@ -226,4 +226,10 @@ class FileLink:
226
226
  # Re-add the file to watcher so we keep listening for future changes
227
227
  if self._file_watcher is not None:
228
228
  self._file_watcher.addPath(changed_path)
229
- self._watch_file_changes = True
229
+ self._watch_file_changes = True
230
+
231
+ def unload(self):
232
+ if self._file_watcher:
233
+ self._file_watcher.fileChanged.disconnect(self._on_file_changed)
234
+ super().unload()
235
+
@@ -5,6 +5,7 @@ from qtpy.QtWidgets import QTabWidget, QShortcut, QMessageBox, QMenu, QStyle, \
5
5
  QApplication, QTabBar
6
6
  from qtpy.QtCore import Signal, Qt, QMimeData, QPoint, QByteArray, QDataStream
7
7
  from ..code_editors import create_editor
8
+ from ..mixins import Base
8
9
  from .. import settings, utils
9
10
  from ..signal_router import signal_router
10
11
  logger = logging.getLogger(__name__)
@@ -240,7 +241,8 @@ class TabbedEditor(QTabWidget):
240
241
  self.setTabText(index, title)
241
242
  return
242
243
  logger.info(f'language changed from {from_language} to {to_language}')
243
- self.removeTab(index)
244
+ editor.unload()
245
+ self.removeTab(index)
244
246
  self.add_code_editor(to_path, index=index)
245
247
 
246
248
  def add_code_editor(self, path=None, index=None):
@@ -332,17 +334,18 @@ class TabbedEditor(QTabWidget):
332
334
  dataByteArray = event.mimeData().data("application/x-tabdata")
333
335
  stream = QDataStream(dataByteArray, QDataStream.ReadOnly)
334
336
  tabText = stream.readQString()
335
- # (We ignore the icon detail in this example or simply set a blank icon.)
336
- # If you’re handing around pixmaps, you could store them more explicitly.
337
-
338
337
  # The source tab's DraggableTabBar has already removed it from its QTabWidget.
339
338
  # But we need the actual widget object that was being dragged. It's part
340
339
  # of the QDrag's source — we can find it by casting. We must be careful:
341
340
  sourceBar = event.source()
342
341
  if isinstance(sourceBar, DraggableTabBar):
343
- draggedWidget = sourceBar.draggedWidget
344
- else:
345
- draggedWidget = None
342
+ editor = sourceBar.draggedWidget
343
+ if not isinstance(editor, Base):
344
+ logger.warning(f'expecting editor, found {editor}')
345
+ return
346
+ editor.modification_changed.connect(self._on_modification_changed)
347
+ editor.file_name_changed.connect(self._on_file_name_changed)
348
+ logger.info("dropping editor")
346
349
 
347
350
  # Insert the tab at the position that the user dropped on
348
351
  dropPos = event.position().toPoint()
@@ -351,7 +354,7 @@ class TabbedEditor(QTabWidget):
351
354
  if index < 0:
352
355
  # If the user dropped to the right of all existing tabs
353
356
  index = self.count()
354
-
355
- self.insertTab(index, draggedWidget, tabText)
357
+
358
+ self.insertTab(index, editor, tabText)
356
359
  self.setCurrentIndex(index)
357
360