pyqt-code-editor 0.0.56__tar.gz → 0.0.58__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 (92) hide show
  1. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/PKG-INFO +1 -1
  2. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/__init__.py +1 -1
  3. pyqt_code_editor-0.0.58/pyqt_code_editor/components/sigmund/sigmund_analyst_chat_widget.py +65 -0
  4. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/utils/languages/python/_auto_indent.py +0 -1
  5. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/utils/languages/python/_mask_str_in_code.py +1 -1
  6. pyqt_code_editor-0.0.56/pyqt_code_editor/components/sigmund/sigmund_analyst_chat_widget.py +0 -35
  7. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/COPYING +0 -0
  8. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyproject.toml +0 -0
  9. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/_settings.py +0 -0
  10. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/app.py +0 -0
  11. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/code_editors/__init__.py +0 -0
  12. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/code_editors/code_editors.py +0 -0
  13. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/code_editors/languages/__init__.py +0 -0
  14. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/code_editors/languages/generic.py +0 -0
  15. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/code_editors/languages/javascript.py +0 -0
  16. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/code_editors/languages/markdown.py +0 -0
  17. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/code_editors/languages/python.py +0 -0
  18. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/code_editors/languages/text.py +0 -0
  19. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/__init__.py +0 -0
  20. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/editor_panel.py +0 -0
  21. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/find_in_files.py +0 -0
  22. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/jupyter_console/__init__.py +0 -0
  23. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/jupyter_console/jupyter_console.py +0 -0
  24. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/jupyter_console/jupyter_console_tab.py +0 -0
  25. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/jupyter_console/kernel_spec_manager.py +0 -0
  26. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/project_explorer.py +0 -0
  27. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/settings_panel.py +0 -0
  28. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/sigmund/__init__.py +0 -0
  29. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/sigmund/confirm_run_code_dialog.py +0 -0
  30. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/sigmund/editor_workspace.py +0 -0
  31. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/sigmund/sigmund.py +0 -0
  32. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/sigmund/sigmund_analyst_widget.py +0 -0
  33. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/components/workspace_explorer.py +0 -0
  34. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/environment_manager.py +0 -0
  35. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/__init__.py +0 -0
  36. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/auto_indent.py +0 -0
  37. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/auto_pair.py +0 -0
  38. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/base.py +0 -0
  39. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/check.py +0 -0
  40. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/comment.py +0 -0
  41. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/complete.py +0 -0
  42. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/execute.py +0 -0
  43. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/file_link.py +0 -0
  44. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/highlight_matching_brackets.py +0 -0
  45. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/line_number.py +0 -0
  46. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/merge_undo_actions.py +0 -0
  47. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/python_auto_indent.py +0 -0
  48. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/search_replace.py +0 -0
  49. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/shortcuts.py +0 -0
  50. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/smart_backspace_delete.py +0 -0
  51. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/symbols.py +0 -0
  52. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/theme.py +0 -0
  53. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/widgets/__init__.py +0 -0
  54. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/mixins/zoom.py +0 -0
  55. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/sigmund-analyst.png +0 -0
  56. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/signal_router.py +0 -0
  57. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/syntax_highlighters/__init__.py +0 -0
  58. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/syntax_highlighters/languages/__init__.py +0 -0
  59. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/syntax_highlighters/languages/generic.py +0 -0
  60. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/syntax_highlighters/languages/python.py +0 -0
  61. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/syntax_highlighters/syntax_highlighter.py +0 -0
  62. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/themes.py +0 -0
  63. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/utils/__init__.py +0 -0
  64. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/utils/languages/__init__.py +0 -0
  65. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/utils/languages/python/__init__.py +0 -0
  66. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/utils/languages/python/_extract_cells.py +0 -0
  67. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/watchdog.py +0 -0
  68. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/widgets/__init__.py +0 -0
  69. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/widgets/calltip_widget.py +0 -0
  70. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/widgets/completion_popup.py +0 -0
  71. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/widgets/dock.py +0 -0
  72. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/widgets/quick_open_dialog.py +0 -0
  73. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/widgets/quick_open_file_dialog.py +0 -0
  74. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/widgets/quick_symbol_dialog.py +0 -0
  75. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/widgets/search_replace_frame.py +0 -0
  76. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/widgets/tab_splitter.py +0 -0
  77. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/widgets/tabbed_editor.py +0 -0
  78. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/worker/__init__.py +0 -0
  79. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/worker/languages/__init__.py +0 -0
  80. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/worker/languages/generic.py +0 -0
  81. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/worker/languages/python.py +0 -0
  82. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/worker/manager.py +0 -0
  83. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/worker/process.py +0 -0
  84. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/worker/providers/__init__.py +0 -0
  85. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/worker/providers/codestral.py +0 -0
  86. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/worker/providers/jedi.py +0 -0
  87. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/worker/providers/ruff.py +0 -0
  88. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/worker/providers/sigmund.py +0 -0
  89. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/worker/providers/symbol.py +0 -0
  90. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/worker/providers/tree_sitter.py +0 -0
  91. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/pyqt_code_editor/worker/settings.py +0 -0
  92. {pyqt_code_editor-0.0.56 → pyqt_code_editor-0.0.58}/readme.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqt_code_editor
3
- Version: 0.0.56
3
+ Version: 0.0.58
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.56'
5
+ __version__ = '0.0.58'
@@ -0,0 +1,65 @@
1
+ from qtpy.QtWidgets import (QCheckBox, QWidget, QVBoxLayout, QLabel,
2
+ QMessageBox)
3
+ from sigmund_qtwidget.chat_widget import ChatWidget
4
+ from ... import settings
5
+
6
+
7
+ class SigmundAnalystChatWidget(ChatWidget):
8
+ """Extended chat widget with Sigmund Analyst-specific options"""
9
+
10
+ def __init__(self, parent=None):
11
+ super().__init__(parent)
12
+ main_layout = self.layout()
13
+ # Warning banner shown when review is disabled (initially hidden)
14
+ self._review_warning_label = QLabel(
15
+ "⚠️ Review is disabled! Sigmund has full, unreviewed access to "
16
+ "your computer's files and can execute arbitrary actions.")
17
+ self._review_warning_label.setWordWrap(True)
18
+ self._review_warning_label.setStyleSheet(
19
+ "background-color: #ffcccc; color: #800000; "
20
+ "padding: 10px; border-radius: 3px;")
21
+ self._review_warning_label.setVisible(
22
+ not settings.sigmund_review_actions)
23
+ main_layout.insertWidget(0, self._review_warning_label)
24
+ # Create a container for the checkboxes
25
+ options_container = QWidget()
26
+ options_layout = QVBoxLayout(options_container)
27
+ options_layout.setContentsMargins(5, 5, 5, 5)
28
+ options_layout.setSpacing(2)
29
+ # "Review proposed changes" checkbox
30
+ self._review_actions_checkbox = QCheckBox(
31
+ "Review Sigmund's actions (recommended)")
32
+ self._review_actions_checkbox.setChecked(
33
+ settings.sigmund_review_actions)
34
+ self._review_actions_checkbox.stateChanged.connect(
35
+ self._on_review_actions_changed)
36
+ options_layout.addWidget(self._review_actions_checkbox)
37
+ # Insert the options container before the input container
38
+ main_layout.insertWidget(main_layout.count(), options_container)
39
+
40
+ def _on_review_actions_changed(self, state):
41
+ """Store the review changes setting."""
42
+ review = bool(state)
43
+ if not review:
44
+ reply = QMessageBox.warning(
45
+ self,
46
+ "Disable review?",
47
+ "⚠️ Warning: By disabling review, Sigmund will have full, "
48
+ "unreviewed access to your computer's files and can execute "
49
+ "arbitrary actions without asking for confirmation first.\n\n"
50
+ "Are you sure you want to disable review?",
51
+ QMessageBox.Yes | QMessageBox.No,
52
+ QMessageBox.No)
53
+ if reply != QMessageBox.Yes:
54
+ # Revert the checkbox without triggering stateChanged again
55
+ self._review_actions_checkbox.blockSignals(True)
56
+ self._review_actions_checkbox.setChecked(True)
57
+ self._review_actions_checkbox.blockSignals(False)
58
+ return
59
+ self._review_warning_label.setVisible(not review)
60
+ settings.sigmund_review_actions = review
61
+
62
+ def append_message(self, msg_type, text, scroll=True):
63
+ if msg_type == 'ai' and '(Suggesting IDE action)' in text:
64
+ text = '⚙️ Sigmund is working …'
65
+ self._chat_browser.append_message(msg_type, text, scroll)
@@ -565,7 +565,6 @@ def _indent_inside_uncloded_list_tuple_set_or_dict(code: str, char_idx: int) ->
565
565
  bracket_line_idx, bracket_col_idx = _line_col_from_idx(code, char_idx)
566
566
  # Get the line where the last unclosed parenthesis is
567
567
  bracket_line = lines[bracket_line_idx]
568
- bracket_line_indent = get_leading_spaces(bracket_line)
569
568
 
570
569
  # Check text after bracket on same line
571
570
  post_bracket_text_idx = None
@@ -175,7 +175,7 @@ def mask_str_in_code(code: str, mask_char: str = 'X') -> str:
175
175
  masked_parts.append(masked_string)
176
176
  last_end = token.end
177
177
 
178
- except tokenize.TokenError:
178
+ except (tokenize.TokenError, IndentationError):
179
179
  # Handle incomplete code
180
180
  pass
181
181
 
@@ -1,35 +0,0 @@
1
- from qtpy.QtWidgets import QCheckBox, QWidget, QVBoxLayout
2
- from sigmund_qtwidget.chat_widget import ChatWidget
3
- from ... import settings
4
-
5
-
6
- class SigmundAnalystChatWidget(ChatWidget):
7
- """Extended chat widget with Sigmund Analyst-specific options"""
8
-
9
- def __init__(self, parent=None):
10
- super().__init__(parent)
11
- # Create a container for the checkboxes
12
- options_container = QWidget()
13
- options_layout = QVBoxLayout(options_container)
14
- options_layout.setContentsMargins(5, 5, 5, 5)
15
- options_layout.setSpacing(2)
16
- # "Review proposed changes" checkbox
17
- self._review_actions_checkbox = QCheckBox(
18
- "Review Sigmund's actions (recommended)")
19
- self._review_actions_checkbox.setChecked(
20
- settings.sigmund_review_actions)
21
- self._review_actions_checkbox.stateChanged.connect(
22
- self._on_review_actions_changed)
23
- options_layout.addWidget(self._review_actions_checkbox)
24
- # Insert the options container before the input container
25
- main_layout = self.layout()
26
- main_layout.insertWidget(main_layout.count(), options_container)
27
-
28
- def _on_review_actions_changed(self, state):
29
- """Store the review changes setting."""
30
- settings.sigmund_review_actions = bool(state)
31
-
32
- def append_message(self, msg_type, text, scroll=True):
33
- if msg_type == 'ai' and '(Suggesting IDE action)' in text:
34
- text = '⚙️ Sigmund is working …'
35
- self._chat_browser.append_message(msg_type, text, scroll)