##// END OF EJS Templates
Start webbrowser in a thread. Prevents lockup with Chrome....
Start webbrowser in a thread. Prevents lockup with Chrome. If a user has Chrome set as their default browser (system-wide or via the `BROWSER` environment variable), opening the notebook hangs because the chrome call doesn't return immediately. This solves the issue by opening the browser in a thread. Note that there remains an issue where killing the notebook will kill Chrome if the Chrome session was started by us. I haven't found a way to work around that despite attempts by making the webbrowser.open() call in a subprocess.

File last commit:

r2498:3eae1372
r5212:2178365f
Show More
ipy_pydb.py
31 lines | 813 B | text/x-python | PythonLexer
import inspect
from IPython.core import ipapi
from IPython.utils.process import arg_split
ip = ipapi.get()
from IPython.core import debugger
def call_pydb(self, args):
"""Invoke pydb with the supplied parameters."""
try:
import pydb
except ImportError:
raise ImportError("pydb doesn't seem to be installed.")
if not hasattr(pydb.pydb, "runv"):
raise ImportError("You need pydb version 1.19 or later installed.")
argl = arg_split(args)
# print argl # dbg
if len(inspect.getargspec(pydb.runv)[0]) == 2:
pdb = debugger.Pdb(color_scheme=self.colors)
ip.history_saving_wrapper( lambda : pydb.runv(argl, pdb) )()
else:
ip.history_saving_wrapper( lambda : pydb.runv(argl) )()
ip.define_magic("pydb",call_pydb)