##// END OF EJS Templates
notebook: Print a warning (but do not abort) if no webbrowser can be found....
Bradley M. Froehle -
Show More
@@ -551,10 +551,11 b' class NotebookApp(BaseIPythonApplication):'
551
551
552 if self.open_browser or self.file_to_run:
552 if self.open_browser or self.file_to_run:
553 ip = self.ip or '127.0.0.1'
553 ip = self.ip or '127.0.0.1'
554 if self.browser:
554 try:
555 browser = webbrowser.get(self.browser)
555 browser = webbrowser.get(self.browser or None)
556 else:
556 except webbrowser.Error as e:
557 browser = webbrowser.get()
557 self.log.warn('No web browser found: %s.' % e)
558 browser = None
558
559
559 if self.file_to_run:
560 if self.file_to_run:
560 filename, _ = os.path.splitext(os.path.basename(self.file_to_run))
561 filename, _ = os.path.splitext(os.path.basename(self.file_to_run))
@@ -566,10 +567,10 b' class NotebookApp(BaseIPythonApplication):'
566 url = ''
567 url = ''
567 else:
568 else:
568 url = ''
569 url = ''
569 b = lambda : browser.open("%s://%s:%i%s%s" % (proto, ip,
570 if browser:
570 self.port, self.base_project_url, url),
571 b = lambda : browser.open("%s://%s:%i%s%s" % (proto, ip,
571 new=2)
572 self.port, self.base_project_url, url), new=2)
572 threading.Thread(target=b).start()
573 threading.Thread(target=b).start()
573 try:
574 try:
574 ioloop.IOLoop.instance().start()
575 ioloop.IOLoop.instance().start()
575 except KeyboardInterrupt:
576 except KeyboardInterrupt:
General Comments 0
You need to be logged in to leave comments. Login now