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.
Files changed (73) hide show
  1. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/PKG-INFO +1 -1
  2. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/__init__.py +1 -1
  3. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/_settings.py +3 -0
  4. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/app.py +3 -3
  5. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/jupyter_console.py +81 -47
  6. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/completion_popup.py +3 -1
  7. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/COPYING +0 -0
  8. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyproject.toml +0 -0
  9. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/__init__.py +0 -0
  10. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/code_editors.py +0 -0
  11. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/languages/__init__.py +0 -0
  12. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/languages/generic.py +0 -0
  13. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/languages/markdown.py +0 -0
  14. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/languages/python.py +0 -0
  15. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/code_editors/languages/text.py +0 -0
  16. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/__init__.py +0 -0
  17. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/editor_panel.py +0 -0
  18. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/find_in_files.py +0 -0
  19. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/project_explorer.py +0 -0
  20. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/settings_panel.py +0 -0
  21. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/sigmund.py +0 -0
  22. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/components/workspace_explorer.py +0 -0
  23. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/__init__.py +0 -0
  24. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/auto_indent.py +0 -0
  25. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/auto_pair.py +0 -0
  26. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/base.py +0 -0
  27. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/check.py +0 -0
  28. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/comment.py +0 -0
  29. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/complete.py +0 -0
  30. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/execute.py +0 -0
  31. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/file_link.py +0 -0
  32. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/line_number.py +0 -0
  33. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/python_auto_indent.py +0 -0
  34. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/search_replace.py +0 -0
  35. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/shortcuts.py +0 -0
  36. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/smart_backspace_delete.py +0 -0
  37. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/symbols.py +0 -0
  38. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/theme.py +0 -0
  39. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/widgets/__init__.py +0 -0
  40. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/mixins/zoom.py +0 -0
  41. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/python_utils.py +0 -0
  42. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/signal_router.py +0 -0
  43. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/syntax_highlighters/__init__.py +0 -0
  44. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/syntax_highlighters/languages/__init__.py +0 -0
  45. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/syntax_highlighters/languages/generic.py +0 -0
  46. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/syntax_highlighters/languages/python.py +0 -0
  47. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/syntax_highlighters/syntax_highlighter.py +0 -0
  48. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/themes.py +0 -0
  49. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/utils.py +0 -0
  50. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/watchdog.py +0 -0
  51. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/__init__.py +0 -0
  52. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/calltip_widget.py +0 -0
  53. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/dock.py +0 -0
  54. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/quick_open_dialog.py +0 -0
  55. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/quick_open_file_dialog.py +0 -0
  56. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/quick_symbol_dialog.py +0 -0
  57. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/search_replace_frame.py +0 -0
  58. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/tab_splitter.py +0 -0
  59. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/widgets/tabbed_editor.py +0 -0
  60. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/__init__.py +0 -0
  61. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/languages/__init__.py +0 -0
  62. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/languages/generic.py +0 -0
  63. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/languages/python.py +0 -0
  64. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/manager.py +0 -0
  65. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/process.py +0 -0
  66. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/__init__.py +0 -0
  67. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/codestral.py +0 -0
  68. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/jedi.py +0 -0
  69. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/ruff.py +0 -0
  70. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/sigmund.py +0 -0
  71. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/providers/symbol.py +0 -0
  72. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/pyqt_code_editor/worker/settings.py +0 -0
  73. {pyqt_code_editor-0.0.8 → pyqt_code_editor-0.0.10}/readme.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqt_code_editor
3
- Version: 0.0.8
3
+ Version: 0.0.10
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.8'
5
+ __version__ = '0.0.10'
@@ -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(parent=self)
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
 
@@ -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) # Signal for workspace updates
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
- # Initialize the tab widget
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
- # Create corner widget with multiple buttons
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) # Make the button flat
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) # Make the button flat
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) # Make the button flat
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
- # Create kernel menu
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.update_workspace()
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
- kernel_name = action.data()
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
- # Create and add the new tab
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
- success = console.restart_kernel()
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
- success = console.interrupt_kernel()
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, dict):
503
- """Handle workspace updated signal from a console tab"""
504
- self.workspace_updated.emit(dict)
537
+ def handle_workspace_updated(self, data):
538
+ self.workspace_updated.emit(data)
@@ -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.FramelessWindowHint | Qt.Tool)
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)