##// END OF EJS Templates
Allow the user to interact with link anchors in the qtconsole...
Allow the user to interact with link anchors in the qtconsole Since the qtconsole can display hyperlinks, it would be useful to allow interacting with them. This adds showing a tooltip when the mouse is over a link. The tooltip code stores the anchor in ConsoleWidget._anchor, so when the user right-clicks to select the context menu for "Open Link" or "Copy Link Address", it uses the text that was displayed and not whats under the current context menu pointer location. Also storing the anchor allows me to check to see if we've already displayed that anchor on a new mouseMoveEvent so the tooltip doesn't keep getting redrawn.

File last commit:

r7876:ae3a5bcc
r8532:9891d074
Show More
test_kernelsession.py
27 lines | 835 B | text/x-python | PythonLexer
Brian E. Granger
Refactoring the notebook app to support the new config system.
r4344 """Tests for the notebook kernel and session manager."""
Brian E. Granger
Refactored htmlnotebook session and kernel manager....
r4343
from unittest import TestCase
MinRK
use zmq.KernelManager to manage individual kernels in notebook...
r4960 from IPython.frontend.html.notebook.kernelmanager import MultiKernelManager
Brian E. Granger
Refactored htmlnotebook session and kernel manager....
r4343
class TestKernelManager(TestCase):
def test_km_lifecycle(self):
MinRK
use zmq.KernelManager to manage individual kernels in notebook...
r4960 km = MultiKernelManager()
Brian E. Granger
Refactored htmlnotebook session and kernel manager....
r4343 kid = km.start_kernel()
Bradley M. Froehle
s/assert_/assertTrue/
r7876 self.assertTrue(kid in km)
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual(len(km),1)
Brian E. Granger
Refactored htmlnotebook session and kernel manager....
r4343 km.kill_kernel(kid)
Bradley M. Froehle
s/assert_/assertTrue/
r7876 self.assertTrue(not kid in km)
Brian E. Granger
Refactored htmlnotebook session and kernel manager....
r4343
kid = km.start_kernel()
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual('127.0.0.1',km.get_kernel_ip(kid))
Brian E. Granger
Refactored htmlnotebook session and kernel manager....
r4343 port_dict = km.get_kernel_ports(kid)
Bradley M. Froehle
s/assert_/assertTrue/
r7876 self.assertTrue('stdin_port' in port_dict)
self.assertTrue('iopub_port' in port_dict)
self.assertTrue('shell_port' in port_dict)
self.assertTrue('hb_port' in port_dict)
MinRK
use zmq.KernelManager to manage individual kernels in notebook...
r4960 km.get_kernel(kid)
MinRK
cleanup dangling kernel in test_kernelsession
r5629 km.kill_kernel(kid)
Brian E. Granger
Refactored htmlnotebook session and kernel manager....
r4343