-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🎉 Adds kernel menu to control kernel #282
Conversation
pyflow/graphics/window.py
Outdated
def stop_kernel(self): | ||
"""Stop the kernel.""" | ||
current_window = self.activeMdiChild() | ||
if current_window is not None: | ||
current_window.scene.kernel.stop() | ||
self.reset_block_states() | ||
self.statusbar.showMessage("Kernel stopped") | ||
else: | ||
self.statusbar.showMessage("No active window") | ||
|
||
def restart_kernel(self): | ||
"""Restart the kernel.""" | ||
current_window = self.activeMdiChild() | ||
if current_window is not None: | ||
current_window.scene.kernel.restart() | ||
self.reset_block_states() | ||
self.statusbar.showMessage("Kernel restarted") | ||
else: | ||
self.statusbar.showMessage("No active window") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those functions are nearly the same, try to reduce duplication by using an other (private) method
Restarting the kernel introduces weird bugs. I ran A then restarted the kernel and ran B. B should output an error but does not. Plus I would need to reset the kernel CWD every time I restart the kernel which means accessing saving_path from where I restart the kernel. I am closing this PR for the time being |
That's sad, this would be a very nice feature :/ |
fixes #274