pyqt-code-editor 0.0.3__tar.gz → 0.0.5__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.
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/PKG-INFO +1 -1
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/__init__.py +1 -1
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/_settings.py +1 -14
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/app.py +1 -1
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/components/sigmund.py +39 -9
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/COPYING +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyproject.toml +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/code_editors/__init__.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/code_editors/code_editors.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/code_editors/languages/__init__.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/code_editors/languages/generic.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/code_editors/languages/markdown.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/code_editors/languages/python.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/code_editors/languages/text.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/components/__init__.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/components/editor_panel.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/components/find_in_files.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/components/jupyter_console.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/components/project_explorer.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/components/settings_panel.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/components/workspace_explorer.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/__init__.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/auto_indent.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/auto_pair.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/base.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/check.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/comment.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/complete.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/execute.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/file_link.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/line_number.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/python_auto_indent.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/search_replace.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/shortcuts.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/smart_backspace_delete.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/symbols.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/theme.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/widgets/__init__.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/zoom.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/python_utils.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/signal_router.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/syntax_highlighters/__init__.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/syntax_highlighters/languages/__init__.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/syntax_highlighters/languages/generic.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/syntax_highlighters/languages/python.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/syntax_highlighters/syntax_highlighter.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/themes.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/utils.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/watchdog.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/__init__.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/calltip_widget.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/completion_popup.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/dock.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/quick_open_dialog.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/quick_open_file_dialog.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/quick_symbol_dialog.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/search_replace_frame.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/tab_splitter.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/tabbed_editor.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/__init__.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/languages/__init__.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/languages/generic.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/languages/python.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/manager.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/process.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/providers/__init__.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/providers/codestral.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/providers/jedi.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/providers/ruff.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/providers/sigmund.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/providers/symbol.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/settings.py +0 -0
- {pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/readme.md +0 -0
|
@@ -57,23 +57,10 @@ class Settings(QObject):
|
|
|
57
57
|
# Signal emitted when any setting changes: (setting_name, new_value)
|
|
58
58
|
setting_changed = Signal(str, object)
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
_instance = None
|
|
62
|
-
|
|
63
|
-
def __new__(cls):
|
|
64
|
-
if cls._instance is None:
|
|
65
|
-
cls._instance = super(Settings, cls).__new__(cls)
|
|
66
|
-
cls._instance._initialized = False
|
|
67
|
-
return cls._instance
|
|
68
|
-
|
|
69
|
-
def __init__(self):
|
|
70
|
-
if self._initialized:
|
|
71
|
-
return
|
|
72
|
-
|
|
60
|
+
def __init__(self):
|
|
73
61
|
super().__init__()
|
|
74
62
|
self._values = {}
|
|
75
63
|
self._qsettings = QSettings("cogscinl", "Sigmund Analyst")
|
|
76
|
-
self._initialized = True
|
|
77
64
|
logger.info("Initializing Settings manager")
|
|
78
65
|
self._load_settings()
|
|
79
66
|
|
|
@@ -3,7 +3,7 @@ import sys
|
|
|
3
3
|
import logging
|
|
4
4
|
from qtpy.QtWidgets import QMainWindow, QShortcut, QMessageBox, \
|
|
5
5
|
QDockWidget, QToolBar, QAction, QApplication
|
|
6
|
-
from qtpy.QtCore import Qt,
|
|
6
|
+
from qtpy.QtCore import Qt, QSize
|
|
7
7
|
from qtpy.QtGui import QKeySequence
|
|
8
8
|
import qtawesome as qta
|
|
9
9
|
from .widgets import QuickOpenFileDialog
|
|
@@ -1,13 +1,40 @@
|
|
|
1
1
|
from sigmund_qtwidget.sigmund_widget import SigmundWidget
|
|
2
2
|
from ..widgets import Dock
|
|
3
3
|
from .. import watchdog
|
|
4
|
+
import textwrap
|
|
4
5
|
import logging
|
|
5
|
-
logging.basicConfig(level=logging.
|
|
6
|
+
logging.basicConfig(level=logging.INFO, force=True)
|
|
7
|
+
logger = logging.getLogger(__name__)
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
class EditorWorkspace:
|
|
9
11
|
def __init__(self, editor_panel):
|
|
10
12
|
self._editor_panel = editor_panel
|
|
13
|
+
self._indentation = ''
|
|
14
|
+
|
|
15
|
+
def _get_indentation(self, content):
|
|
16
|
+
dedented = textwrap.dedent(content)
|
|
17
|
+
lines = content.splitlines()
|
|
18
|
+
dedented_lines = dedented.splitlines()
|
|
19
|
+
|
|
20
|
+
for original_line, dedented_line in zip(lines, dedented_lines):
|
|
21
|
+
# Skip empty lines
|
|
22
|
+
if original_line.strip():
|
|
23
|
+
# Count leading whitespace
|
|
24
|
+
orig_leading = len(original_line) - len(original_line.lstrip(' \t'))
|
|
25
|
+
ded_leading = len(dedented_line) - len(dedented_line.lstrip(' \t'))
|
|
26
|
+
# The difference should be the indentation sequence
|
|
27
|
+
indentation_length = orig_leading - ded_leading
|
|
28
|
+
if indentation_length > 0:
|
|
29
|
+
return original_line[:indentation_length]
|
|
30
|
+
return ""
|
|
31
|
+
# If no non-empty lines, return no indentation
|
|
32
|
+
return ""
|
|
33
|
+
|
|
34
|
+
def prepare(self, content):
|
|
35
|
+
if content is None:
|
|
36
|
+
return content
|
|
37
|
+
return textwrap.indent(content, self._indentation)
|
|
11
38
|
|
|
12
39
|
@property
|
|
13
40
|
def _editor(self):
|
|
@@ -33,8 +60,12 @@ class EditorWorkspace:
|
|
|
33
60
|
def get(self):
|
|
34
61
|
text_cursor = self._editor.textCursor()
|
|
35
62
|
if text_cursor.hasSelection():
|
|
36
|
-
|
|
37
|
-
|
|
63
|
+
content = self._normalize_line_breaks(text_cursor.selectedText())
|
|
64
|
+
else:
|
|
65
|
+
content = self._editor.toPlainText()
|
|
66
|
+
self._indentation = self._get_indentation(content)
|
|
67
|
+
logger.info(f'content was indented by "{self._indentation}"')
|
|
68
|
+
return content, self._editor.code_editor_language
|
|
38
69
|
|
|
39
70
|
def set(self, content, language):
|
|
40
71
|
text_cursor = self._editor.textCursor()
|
|
@@ -51,8 +82,6 @@ class EditorWorkspace:
|
|
|
51
82
|
else:
|
|
52
83
|
editor_content = self._editor.toPlainText()
|
|
53
84
|
|
|
54
|
-
if not content:
|
|
55
|
-
return False
|
|
56
85
|
if content in (editor_content, self.strip_content(editor_content)):
|
|
57
86
|
return False
|
|
58
87
|
return True
|
|
@@ -70,13 +99,14 @@ class Sigmund(Dock):
|
|
|
70
99
|
workspace = EditorWorkspace(editor_panel)
|
|
71
100
|
self.sigmund_widget = SigmundWidget(self)
|
|
72
101
|
self.sigmund_widget.set_workspace_manager(workspace)
|
|
73
|
-
self.sigmund_widget.start_server()
|
|
74
|
-
watchdog.register_subprocess(self.sigmund_widget.server_pid)
|
|
75
102
|
self.setWidget(self.sigmund_widget)
|
|
76
|
-
self.visibilityChanged.connect(self._on_visibility_changed)
|
|
77
103
|
|
|
78
|
-
def
|
|
104
|
+
def setVisible(self, visible):
|
|
79
105
|
if visible:
|
|
106
|
+
logger.info('starting sigmund connector')
|
|
80
107
|
self.sigmund_widget.start_server()
|
|
108
|
+
watchdog.register_subprocess(self.sigmund_widget.server_pid)
|
|
81
109
|
else:
|
|
110
|
+
logger.info('stopping sigmund connector')
|
|
82
111
|
self.sigmund_widget.stop_server()
|
|
112
|
+
super().setVisible(visible)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/code_editors/code_editors.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/code_editors/languages/generic.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/code_editors/languages/python.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/code_editors/languages/text.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/components/editor_panel.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/components/find_in_files.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/components/jupyter_console.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/components/project_explorer.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/components/settings_panel.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/components/workspace_explorer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/python_auto_indent.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/smart_backspace_delete.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/mixins/widgets/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/syntax_highlighters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/calltip_widget.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/completion_popup.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/quick_open_dialog.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/quick_open_file_dialog.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/quick_symbol_dialog.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/widgets/search_replace_frame.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/languages/__init__.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/languages/generic.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/languages/python.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/providers/__init__.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/providers/codestral.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/providers/sigmund.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.3 → pyqt_code_editor-0.0.5}/pyqt_code_editor/worker/providers/symbol.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|