Permalink
Browse files

be more explicit about how --browser value is used

  • Loading branch information...
1 parent 373129a commit 2a436aee039c5cf851d045062142371876685ad3 @ivanov ivanov committed Feb 14, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 IPython/frontend/html/notebook/notebookapp.py
@@ -291,11 +291,11 @@ def _ip_changed(self, name, old, new):
""")
browser = Unicode(u'', config=True,
- help="""Specify which browser to use when opening the
- notebook. If not specified, the default browser will be
- determined by the `webbrowser` standard library module,
- which allows setting of the BROWSER environment variable
- to override it.
+ help="""Specify what command to use to invoke a web
+ browser when opening the notebook. If not specified, the
+ default browser will be determined by the `webbrowser`
+ standard library module, which allows setting of the
+ BROWSER environment variable to override it.
""")
read_only = Bool(False, config=True,
@@ -441,7 +441,7 @@ def start(self):
if self.open_browser:
ip = self.ip or '127.0.0.1'
- if len(self.browser) == 0:
+ if self.browser:
@juliantaylor

juliantaylor Feb 20, 2012

this should probably be
if not self.browser:

currently you get this traceback:

  File "/scratch/jtaylor/progs/localinst/lib/python2.6/site-packages/IPython/frontend/html/notebook/notebookapp.py", line 448, in start
    browser = webbrowser.get(self.browser)
...
  File "/usr/lib/python2.6/webbrowser.py", line 84, in _synthesize
    cmd = browser.split()[0]
IndexError: list index out of range
@minrk

minrk Feb 20, 2012

Owner

Yes, of course it should. I'll push this right now.

browser = webbrowser.get()
else:
browser = webbrowser.get(self.browser)

0 comments on commit 2a436ae

Please sign in to comment.