Skip to content

Commit

Permalink
FIX: removed double link when custom_display_url (#5400)
Browse files Browse the repository at this point in the history
  • Loading branch information
Laura Merlo committed Jun 20, 2020
1 parent 9fa644b commit 95348dd
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions notebook/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,8 @@ def display_url(self):
url = self._tcp_url(ip)
if self.token and not self.sock:
url = self._concat_token(url)
url += '\n or %s' % self._concat_token(self._tcp_url('127.0.0.1'))
if not self.custom_display_url:
url += '\n or %s' % self._concat_token(self._tcp_url('127.0.0.1'))
return url

@property
Expand Down Expand Up @@ -2216,13 +2217,22 @@ def start(self):
) % (self.sock, self._concat_token(self._tcp_url('localhost', 8888)))
]))
else:
self.log.critical('\n'.join([
'\n',
'To access the notebook, open this file in a browser:',
' %s' % urljoin('file:', pathname2url(self.browser_open_file)),
'Or copy and paste one of these URLs:',
' %s' % self.display_url,
]))
if not self.custom_display_url:
self.log.critical('\n'.join([
'\n',
'To access the notebook, open this file in a browser:',
' %s' % urljoin('file:', pathname2url(self.browser_open_file)),
'Or copy and paste one of these URLs:',
' %s' % self.display_url,
]))
else:
self.log.critical('\n'.join([
'\n',
'To access the notebook, open this file in a browser:',
' %s' % urljoin('file:', pathname2url(self.browser_open_file)),
'Or copy and paste this URL:',
' %s' % self.display_url,
]))

self.io_loop = ioloop.IOLoop.current()
if sys.platform.startswith('win'):
Expand Down

0 comments on commit 95348dd

Please sign in to comment.