Skip to content

Commit

Permalink
STY: Removed superfluous comments and debugging print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
cjtitus committed Oct 30, 2024
1 parent 34d3155 commit 8bd19e6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions bluesky_widgets/qt/ipython_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ class QtReIPythonConsole(QWidget):

def __init__(self, model, parent=None):
"""
Initializes the IPythonConsoleTab widget, setting up the IPython console,
kernel manager, and kernel client, and connecting them together.
Initialize the IPython console widget in an unconnected state.
The connection must be initialized by pressing a button in the GUI
Parameters
----------
model : bluesky_widgets.models.run_engine_client.RunEngineClient
Run engine model that provides kernel connection status and control
"""

super().__init__(parent)
Expand All @@ -42,12 +47,11 @@ def __init__(self, model, parent=None):
self.vbox = QVBoxLayout()
self.vbox.addWidget(self.kernel_label)

# Create placeholder widget
# Create placeholder widget before console is initialized
self.placeholder = QLabel("<i>Connect to Kernel by hitting the button when the kernel status is idle</i>")
self.placeholder.setAlignment(Qt.AlignCenter)
self.placeholder.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)

# Add placeholder to layout
self.vbox.addWidget(self.placeholder)

# Create connect button
Expand All @@ -56,9 +60,8 @@ def __init__(self, model, parent=None):
self.connectButton.setEnabled(False)

self.vbox.addWidget(self.connectButton)
# self.vbox.addWidget(QtReStatusMonitor(self.REClientModel))

# Initialize console reference as None
# Initialize console reference as None, just in case
self.console = None
self.kernel_manager = None
self.kernel_client = None
Expand All @@ -84,7 +87,6 @@ def connect_to_kernel(self):
"""
Connects to the IPython kernel when the button is pressed.
"""
print("Connecting to Kernel")

# Clean up existing console if it exists
if self.console is not None:
Expand Down Expand Up @@ -119,7 +121,6 @@ def connect_to_kernel(self):
# Connect the console widget to the kernel
self.console.kernel_manager = self.kernel_manager
self.console.kernel_client = self.kernel_client
print("Done connecting to Kernel")

def is_console_connected(self):
if self.console is not None and self.console.kernel_client and self.console.kernel_client.is_alive():
Expand Down

0 comments on commit 8bd19e6

Please sign in to comment.