pyqt-code-editor 0.0.8__tar.gz → 0.0.10__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.8 → pyqt_code_editor-0.0.10}/PKG-INFO +1 -1
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/__init__.py +1 -1
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/_settings.py +3 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/app.py +3 -3
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/jupyter_console.py +81 -47
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/completion_popup.py +3 -1
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/COPYING +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyproject.toml +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/__init__.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/code_editors.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/languages/__init__.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/languages/generic.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/languages/markdown.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/languages/python.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/languages/text.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/__init__.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/editor_panel.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/find_in_files.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/project_explorer.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/settings_panel.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/sigmund.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/workspace_explorer.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/__init__.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/auto_indent.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/auto_pair.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/base.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/check.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/comment.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/complete.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/execute.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/file_link.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/line_number.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/python_auto_indent.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/search_replace.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/shortcuts.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/smart_backspace_delete.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/symbols.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/theme.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/widgets/__init__.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/zoom.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/python_utils.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/signal_router.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/syntax_highlighters/__init__.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/syntax_highlighters/languages/__init__.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/syntax_highlighters/languages/generic.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/syntax_highlighters/languages/python.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/syntax_highlighters/syntax_highlighter.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/themes.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/utils.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/watchdog.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/__init__.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/calltip_widget.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/dock.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/quick_open_dialog.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/quick_open_file_dialog.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/quick_symbol_dialog.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/search_replace_frame.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/tab_splitter.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/tabbed_editor.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/__init__.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/languages/__init__.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/languages/generic.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/languages/python.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/manager.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/process.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/__init__.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/codestral.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/jedi.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/ruff.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/sigmund.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/symbol.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/settings.py +0 -0
- {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/readme.md +0 -0
|
@@ -75,6 +75,9 @@ class Settings(QObject):
|
|
|
75
75
|
search_replace_background = SettingProperty("#fdff74", "Appearance")
|
|
76
76
|
search_replace_foreground = SettingProperty("#000000", "Appearance")
|
|
77
77
|
|
|
78
|
+
# Jupyter Console
|
|
79
|
+
default_kernel = SettingProperty('python3', "JupyterConsole")
|
|
80
|
+
|
|
78
81
|
# Files and Folders
|
|
79
82
|
current_folder = SettingProperty(os.path.expanduser('~'), "Files")
|
|
80
83
|
default_filename = SettingProperty('untitled.txt', "Files")
|
|
@@ -46,10 +46,10 @@ class MainWindow(QMainWindow):
|
|
|
46
46
|
self._setup_dock_widget(self._workspace_explorer, "Workspace Explorer")
|
|
47
47
|
|
|
48
48
|
# Set up the jupyter console
|
|
49
|
-
self._jupyter_console = JupyterConsole(
|
|
49
|
+
self._jupyter_console = JupyterConsole(
|
|
50
|
+
parent=self, default_kernel=settings.default_kernel)
|
|
50
51
|
self._jupyter_console.workspace_updated.connect(
|
|
51
|
-
self._workspace_explorer.update
|
|
52
|
-
)
|
|
52
|
+
self._workspace_explorer.update)
|
|
53
53
|
self.addDockWidget(Qt.BottomDockWidgetArea, self._jupyter_console)
|
|
54
54
|
self._setup_dock_widget(self._jupyter_console, "Jupyter Console")
|
|
55
55
|
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/jupyter_console.py
RENAMED
|
@@ -52,6 +52,8 @@ class JupyterConsoleTab(QWidget):
|
|
|
52
52
|
self._internal_messages = set()
|
|
53
53
|
# Set of message IDs where output should be hidden
|
|
54
54
|
self._silent_messages = set()
|
|
55
|
+
# Flag to prevent recursive workspace updates
|
|
56
|
+
self._updating_workspace = False
|
|
55
57
|
|
|
56
58
|
# Create Jupyter console widget
|
|
57
59
|
self.jupyter_widget = RichJupyterWidget()
|
|
@@ -93,6 +95,13 @@ class JupyterConsoleTab(QWidget):
|
|
|
93
95
|
.out-prompt-number {{ color: red; }}
|
|
94
96
|
'''
|
|
95
97
|
self.jupyter_widget.setStyleSheet(stylesheet)
|
|
98
|
+
# Recent versions of Jupyter require setting the stylesheet also on the
|
|
99
|
+
# control and page control widget. But these may not exist in older
|
|
100
|
+
# versions.
|
|
101
|
+
if hasattr(self.jupyter_widget, '_control'):
|
|
102
|
+
self.jupyter_widget._control.setStyleSheet(stylesheet)
|
|
103
|
+
if hasattr(self.jupyter_widget, '_page_control'):
|
|
104
|
+
self.jupyter_widget._page_control.setStyleSheet(stylesheet)
|
|
96
105
|
|
|
97
106
|
# Connect execution_complete to auto-update workspace
|
|
98
107
|
self.execution_complete.connect(self._on_execution_complete)
|
|
@@ -185,11 +194,18 @@ class JupyterConsoleTab(QWidget):
|
|
|
185
194
|
|
|
186
195
|
def _on_execution_complete(self, output, content):
|
|
187
196
|
"""Automatically update workspace after regular code execution"""
|
|
197
|
+
# Prevent recursive updates
|
|
198
|
+
if self._updating_workspace:
|
|
199
|
+
return
|
|
188
200
|
# Use a small delay to ensure the kernel has processed everything
|
|
189
201
|
QTimer.singleShot(100, self.update_workspace)
|
|
190
202
|
|
|
191
203
|
def update_workspace(self):
|
|
192
204
|
"""Trigger a workspace update and emit the signal when complete"""
|
|
205
|
+
if self._updating_workspace:
|
|
206
|
+
logger.debug("Workspace update already in progress, skipping")
|
|
207
|
+
return
|
|
208
|
+
self._updating_workspace = True
|
|
193
209
|
future = self.get_workspace_async()
|
|
194
210
|
future.add_done_callback(self._on_workspace_update_complete)
|
|
195
211
|
|
|
@@ -206,6 +222,9 @@ class JupyterConsoleTab(QWidget):
|
|
|
206
222
|
logger.error(f"Error updating workspace: {e}")
|
|
207
223
|
# Emit empty workspace on error
|
|
208
224
|
self.workspace_updated.emit({})
|
|
225
|
+
finally:
|
|
226
|
+
self._updating_workspace = False
|
|
227
|
+
|
|
209
228
|
|
|
210
229
|
def execute_code(self, code):
|
|
211
230
|
"""Execute a code snippet in this kernel"""
|
|
@@ -337,78 +356,94 @@ print(json.dumps({result_var}))
|
|
|
337
356
|
self.kernel_client.stop_channels()
|
|
338
357
|
self.kernel_manager.shutdown_kernel()
|
|
339
358
|
|
|
340
|
-
|
|
341
359
|
class JupyterConsole(Dock):
|
|
342
360
|
"""Dockable widget containing tabbed Jupyter consoles"""
|
|
343
361
|
|
|
344
362
|
execution_complete = Signal(str, object) # Signal for output interception
|
|
345
|
-
workspace_updated = Signal(dict)
|
|
363
|
+
workspace_updated = Signal(dict) # Signal for workspace updates
|
|
346
364
|
|
|
347
365
|
def __init__(self, parent=None, default_kernel='python3'):
|
|
348
366
|
super().__init__("Jupyter Console", parent)
|
|
349
367
|
self.setObjectName('jupyter_console')
|
|
350
368
|
self.default_kernel = default_kernel
|
|
369
|
+
|
|
370
|
+
# ---------------------------------------------------------------------
|
|
371
|
+
# Kernel cache
|
|
372
|
+
# ---------------------------------------------------------------------
|
|
373
|
+
self.available_kernels = [] # will be filled by refresh_kernel_menu()
|
|
351
374
|
|
|
352
|
-
#
|
|
375
|
+
# ---------------------------------------------------------------------
|
|
376
|
+
# UI setup
|
|
377
|
+
# ---------------------------------------------------------------------
|
|
353
378
|
self.tab_widget = QTabWidget()
|
|
354
379
|
self.tab_widget.setTabsClosable(True)
|
|
355
380
|
self.tab_widget.tabCloseRequested.connect(self.close_tab)
|
|
356
381
|
self.tab_widget.currentChanged.connect(self._on_tab_changed)
|
|
357
382
|
self.setWidget(self.tab_widget)
|
|
358
383
|
|
|
359
|
-
#
|
|
384
|
+
# Corner widget with buttons
|
|
360
385
|
corner_widget = QWidget()
|
|
361
386
|
corner_layout = QHBoxLayout(corner_widget)
|
|
362
387
|
corner_layout.setContentsMargins(0, 0, 0, 0)
|
|
363
388
|
corner_layout.setSpacing(HORIZONTAL_SPACING)
|
|
364
389
|
|
|
365
|
-
# Add kernel button (for new kernels)
|
|
366
390
|
self.kernel_button = QToolButton()
|
|
367
391
|
self.kernel_button.setIcon(qta.icon('mdi6.plus'))
|
|
368
392
|
self.kernel_button.setToolTip("Add new kernel")
|
|
369
393
|
self.kernel_button.setPopupMode(QToolButton.InstantPopup)
|
|
370
|
-
self.kernel_button.setAutoRaise(True)
|
|
394
|
+
self.kernel_button.setAutoRaise(True)
|
|
371
395
|
corner_layout.addWidget(self.kernel_button)
|
|
372
396
|
|
|
373
|
-
# Add restart kernel button
|
|
374
397
|
self.restart_button = QToolButton()
|
|
375
398
|
self.restart_button.setIcon(qta.icon('mdi6.restart'))
|
|
376
399
|
self.restart_button.setToolTip("Restart current kernel")
|
|
377
400
|
self.restart_button.clicked.connect(self.restart_current_kernel)
|
|
378
|
-
self.restart_button.setAutoRaise(True)
|
|
401
|
+
self.restart_button.setAutoRaise(True)
|
|
379
402
|
corner_layout.addWidget(self.restart_button)
|
|
380
403
|
|
|
381
|
-
# Add interrupt kernel button
|
|
382
404
|
self.interrupt_button = QToolButton()
|
|
383
405
|
self.interrupt_button.setIcon(qta.icon('mdi6.stop'))
|
|
384
406
|
self.interrupt_button.setToolTip("Interrupt current kernel (Ctrl+C)")
|
|
385
407
|
self.interrupt_button.clicked.connect(self.interrupt_current_kernel)
|
|
386
|
-
self.interrupt_button.setAutoRaise(True)
|
|
408
|
+
self.interrupt_button.setAutoRaise(True)
|
|
387
409
|
corner_layout.addWidget(self.interrupt_button)
|
|
388
410
|
|
|
389
|
-
# Set the corner widget
|
|
390
411
|
self.tab_widget.setCornerWidget(corner_widget)
|
|
391
412
|
|
|
392
|
-
#
|
|
413
|
+
# ---------------------------------------------------------------------
|
|
414
|
+
# Kernel menu
|
|
415
|
+
# ---------------------------------------------------------------------
|
|
393
416
|
self.kernel_menu = QMenu(self.kernel_button)
|
|
394
417
|
self.kernel_button.setMenu(self.kernel_menu)
|
|
395
418
|
self.refresh_kernel_menu()
|
|
396
419
|
|
|
420
|
+
# ---------------------------------------------------------------------
|
|
397
421
|
# Start with a default kernel
|
|
422
|
+
# ---------------------------------------------------------------------
|
|
398
423
|
self.add_console_tab(self.default_kernel)
|
|
399
|
-
|
|
424
|
+
|
|
425
|
+
# -------------------------------------------------------------------------
|
|
426
|
+
# Helper methods
|
|
427
|
+
# -------------------------------------------------------------------------
|
|
400
428
|
def _on_tab_changed(self, index):
|
|
401
429
|
console_tab = self.tab_widget.widget(index)
|
|
402
|
-
console_tab
|
|
430
|
+
if console_tab:
|
|
431
|
+
console_tab.update_workspace()
|
|
403
432
|
|
|
433
|
+
# -------------------------------------------------------------------------
|
|
434
|
+
# Kernel handling
|
|
435
|
+
# -------------------------------------------------------------------------
|
|
404
436
|
def refresh_kernel_menu(self):
|
|
405
|
-
"""Refresh the list of available kernels"""
|
|
437
|
+
"""Refresh the list of available kernels and rebuild the kernel menu."""
|
|
406
438
|
self.kernel_menu.clear()
|
|
407
439
|
|
|
408
440
|
# Get available kernelspecs
|
|
409
441
|
kernel_spec_manager = HomeAwareKernelSpecManager()
|
|
410
442
|
specs = kernel_spec_manager.get_all_specs()
|
|
411
443
|
|
|
444
|
+
# Cache available kernels
|
|
445
|
+
self.available_kernels = list(specs.keys())
|
|
446
|
+
|
|
412
447
|
for spec_name, spec in specs.items():
|
|
413
448
|
display_name = spec['spec']['display_name']
|
|
414
449
|
action = QAction(display_name, self)
|
|
@@ -417,15 +452,26 @@ class JupyterConsole(Dock):
|
|
|
417
452
|
self.kernel_menu.addAction(action)
|
|
418
453
|
|
|
419
454
|
def kernel_menu_triggered(self):
|
|
420
|
-
"""Handle kernel menu item selection"""
|
|
421
455
|
action = self.sender()
|
|
422
456
|
if action:
|
|
423
|
-
|
|
424
|
-
self.add_console_tab(kernel_name)
|
|
457
|
+
self.add_console_tab(action.data())
|
|
425
458
|
|
|
426
459
|
def add_console_tab(self, kernel_name):
|
|
427
|
-
"""Add a new console tab with the specified kernel
|
|
428
|
-
|
|
460
|
+
"""Add a new console tab with the specified kernel.
|
|
461
|
+
Falls back to the first available kernel if the requested one is invalid.
|
|
462
|
+
"""
|
|
463
|
+
if kernel_name not in self.available_kernels:
|
|
464
|
+
if self.available_kernels:
|
|
465
|
+
fallback = self.available_kernels[0]
|
|
466
|
+
logger.warning(
|
|
467
|
+
"Requested kernel '%s' not found. "
|
|
468
|
+
"Falling back to '%s'.", kernel_name, fallback
|
|
469
|
+
)
|
|
470
|
+
kernel_name = fallback
|
|
471
|
+
else:
|
|
472
|
+
logger.error("No available kernels found. Cannot create console tab.")
|
|
473
|
+
return None
|
|
474
|
+
|
|
429
475
|
console_tab = JupyterConsoleTab(kernel_name=kernel_name, parent=self)
|
|
430
476
|
console_tab.execution_complete.connect(self.handle_execution_complete)
|
|
431
477
|
console_tab.workspace_updated.connect(self.handle_workspace_updated)
|
|
@@ -433,72 +479,60 @@ class JupyterConsole(Dock):
|
|
|
433
479
|
self.tab_widget.setCurrentIndex(index)
|
|
434
480
|
return console_tab
|
|
435
481
|
|
|
482
|
+
# -------------------------------------------------------------------------
|
|
483
|
+
# Tab / kernel management
|
|
484
|
+
# -------------------------------------------------------------------------
|
|
436
485
|
def close_tab(self, index):
|
|
437
|
-
"""Close a console tab and shut down its kernel"""
|
|
438
486
|
widget = self.tab_widget.widget(index)
|
|
439
487
|
if widget:
|
|
440
|
-
# Shut down the kernel
|
|
441
488
|
widget.shutdown_kernel()
|
|
442
|
-
|
|
443
|
-
# Remove the tab
|
|
444
489
|
self.tab_widget.removeTab(index)
|
|
445
|
-
|
|
446
|
-
# If that was the last tab, add a new one with the default kernel
|
|
447
490
|
if self.tab_widget.count() == 0:
|
|
448
491
|
self.add_console_tab(self.default_kernel)
|
|
449
492
|
|
|
450
493
|
def get_current_console(self):
|
|
451
|
-
"""Get the currently active console tab"""
|
|
452
494
|
return self.tab_widget.currentWidget()
|
|
453
495
|
|
|
454
496
|
def restart_current_kernel(self):
|
|
455
|
-
"""Restart the kernel in the current tab"""
|
|
456
497
|
console = self.get_current_console()
|
|
457
498
|
if console:
|
|
458
499
|
logger.info("Restarting current kernel")
|
|
459
|
-
|
|
460
|
-
if success:
|
|
500
|
+
if console.restart_kernel():
|
|
461
501
|
logger.info("Kernel restart initiated")
|
|
462
502
|
else:
|
|
463
503
|
logger.warning("Failed to restart kernel")
|
|
464
504
|
|
|
465
505
|
def interrupt_current_kernel(self):
|
|
466
|
-
"""Send interrupt signal to the current kernel"""
|
|
467
506
|
console = self.get_current_console()
|
|
468
507
|
if console:
|
|
469
508
|
logger.info("Interrupting current kernel")
|
|
470
|
-
|
|
471
|
-
if success:
|
|
509
|
+
if console.interrupt_kernel():
|
|
472
510
|
logger.info("Interrupt signal sent to kernel")
|
|
473
511
|
else:
|
|
474
512
|
logger.warning("Failed to interrupt kernel")
|
|
475
513
|
|
|
514
|
+
# -------------------------------------------------------------------------
|
|
515
|
+
# Execution helpers
|
|
516
|
+
# -------------------------------------------------------------------------
|
|
476
517
|
def execute_code(self, code, silent=False):
|
|
477
|
-
"""Execute code in the current console"""
|
|
478
518
|
console = self.get_current_console()
|
|
479
519
|
if console:
|
|
480
|
-
if silent
|
|
481
|
-
console.execute_silently(code)
|
|
482
|
-
else:
|
|
483
|
-
console.execute_code(code)
|
|
520
|
+
(console.execute_silently if silent else console.execute_code)(code)
|
|
484
521
|
|
|
485
522
|
def execute_file(self, filepath):
|
|
486
|
-
"""Execute a file in the current console"""
|
|
487
523
|
console = self.get_current_console()
|
|
488
524
|
if console:
|
|
489
525
|
console.execute_file(filepath)
|
|
490
526
|
|
|
491
527
|
def change_directory(self, directory):
|
|
492
|
-
"""Change working directory of the current console"""
|
|
493
528
|
console = self.get_current_console()
|
|
494
|
-
if console
|
|
495
|
-
return console.change_directory(directory)
|
|
496
|
-
return False
|
|
529
|
+
return console.change_directory(directory) if console else False
|
|
497
530
|
|
|
531
|
+
# -------------------------------------------------------------------------
|
|
532
|
+
# Signals
|
|
533
|
+
# -------------------------------------------------------------------------
|
|
498
534
|
def handle_execution_complete(self, output, result):
|
|
499
|
-
"""Handle execution complete signal from a console tab"""
|
|
500
535
|
self.execution_complete.emit(output, result)
|
|
501
536
|
|
|
502
|
-
def handle_workspace_updated(self,
|
|
503
|
-
|
|
504
|
-
self.workspace_updated.emit(dict)
|
|
537
|
+
def handle_workspace_updated(self, data):
|
|
538
|
+
self.workspace_updated.emit(data)
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/completion_popup.py
RENAMED
|
@@ -25,7 +25,9 @@ class CompletionPopup(QListWidget):
|
|
|
25
25
|
}}''')
|
|
26
26
|
# Use a frameless tool window so it can float above the editor
|
|
27
27
|
# without stealing focus. Note we do NOT use Qt.Popup here.
|
|
28
|
-
self.setWindowFlags(Qt.
|
|
28
|
+
self.setWindowFlags(Qt.Tool | Qt.FramelessWindowHint |
|
|
29
|
+
Qt.NoDropShadowWindowHint |
|
|
30
|
+
Qt.WindowDoesNotAcceptFocus)
|
|
29
31
|
|
|
30
32
|
# Let the editor keep focus
|
|
31
33
|
self.setFocusPolicy(Qt.NoFocus)
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/__init__.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/code_editors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/languages/python.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/languages/text.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/editor_panel.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/find_in_files.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/project_explorer.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/settings_panel.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/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.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/python_auto_indent.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/search_replace.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/smart_backspace_delete.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/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.8 → pyqt_code_editor-0.0.10}/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.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/calltip_widget.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/quick_open_dialog.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/quick_symbol_dialog.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/search_replace_frame.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/tabbed_editor.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/languages/__init__.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/languages/generic.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/languages/python.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/__init__.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/codestral.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/jedi.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/ruff.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/sigmund.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/symbol.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|