Skip to content

Commit 2941158

Browse files
authored
Merge branch 'master' into test_empty_arrows
2 parents dcb45b2 + 56e0833 commit 2941158

File tree

15 files changed

+105
-16
lines changed

15 files changed

+105
-16
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ matrix:
9696
env: GROUP=python
9797
- python: 3.5
9898
env: GROUP=python
99+
- python: "3.7-dev"
100+
env: GROUP=python
99101
- python: 3.6
100102
env: GROUP=docs
101103

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"font-awesome": "components/font-awesome#~4.7.0",
1111
"google-caja": "5669",
1212
"jed": "~1.1.1",
13-
"jquery": "components/jquery#~2.2",
13+
"jquery": "components/jquery#~3.3",
1414
"jquery-typeahead": "~2.0.0",
1515
"jquery-ui": "components/jqueryui#~1.10",
1616
"marked": "~0.3",

docs/source/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ New features:
3030

3131
- The files list now shows file sizes (:ghpull:`3539`)
3232
- Add a quit button in the dashboard (:ghpull:`3004`)
33-
- Display hostname in the terminal when running remotely (:ghpull:`3356`)
33+
- Display hostname in the terminal when running remotely (:ghpull:`3356`, :ghpull:`3593`)
3434
- Add slides exportation/download to the menu (:ghpull:`3287`)
3535
- Add any extra installed nbconvert exporters to the "Download as" menu (:ghpull:`3323`)
3636
- Editor: warning when overwriting a file that is modified on disk (:ghpull:`2783`)

notebook/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99

1010
# Next beta/alpha/rc release: The version number for beta is X.Y.ZbN **without dots**.
1111

12-
version_info = (5, 5, 0, '.dev0')
12+
version_info = (5, 6, 0, '.dev0')
1313
__version__ = '.'.join(map(str, version_info[:3])) + ''.join(version_info[3:])

notebook/notebookapp.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,11 +1339,10 @@ def init_webapp(self):
13391339

13401340
@property
13411341
def display_url(self):
1342-
hostname = socket.gethostname()
1343-
if self.ip in ('localhost', '127.0.0.1', hostname):
1344-
ip = self.ip
1342+
if self.ip in ('', '0.0.0.0'):
1343+
ip = socket.gethostname()
13451344
else:
1346-
ip = hostname
1345+
ip = self.ip
13471346
url = self._url(ip)
13481347
if self.token:
13491348
# Don't log full token if it came from config

notebook/services/kernels/handlers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ class ZMQChannelsHandler(AuthenticatedZMQStreamHandler):
104104

105105
@property
106106
def kernel_info_timeout(self):
107-
return self.settings.get('kernel_info_timeout', 10)
107+
km_default = self.kernel_manager.kernel_info_timeout
108+
return self.settings.get('kernel_info_timeout', km_default)
108109

109110
@property
110111
def iopub_msg_rate_limit(self):

notebook/services/kernels/kernelmanager.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from jupyter_client.session import Session
2020
from jupyter_client.multikernelmanager import MultiKernelManager
2121
from traitlets import (Any, Bool, Dict, List, Unicode, TraitError, Integer,
22-
Instance, default, validate
22+
Float, Instance, default, validate
2323
)
2424

2525
from notebook.utils import to_os_path, exists
@@ -93,6 +93,18 @@ def _update_root_dir(self, proposal):
9393
no frontends are connected.
9494
"""
9595
)
96+
97+
kernel_info_timeout = Float(60, config=True,
98+
help="""Timeout for giving up on a kernel (in seconds).
99+
100+
On starting and restarting kernels, we check whether the
101+
kernel is running and responsive by sending kernel_info_requests.
102+
This sets the timeout in seconds for how long the kernel can take
103+
before being presumed dead.
104+
This affects the MappingKernelManager (which handles kernel restarts)
105+
and the ZMQChannelsHandler (which handles the startup).
106+
"""
107+
)
96108

97109
_kernel_buffers = Any()
98110
@default('_kernel_buffers')
@@ -305,7 +317,7 @@ def on_restart_failed():
305317
kernel.session.send(channel, "kernel_info_request")
306318
channel.on_recv(on_reply)
307319
loop = IOLoop.current()
308-
timeout = loop.add_timeout(loop.time() + 30, on_timeout)
320+
timeout = loop.add_timeout(loop.time() + self.kernel_info_timeout, on_timeout)
309321
return future
310322

311323
def notify_connect(self, kernel_id):
@@ -434,4 +446,3 @@ def cull_kernel_if_idle(self, kernel_id):
434446
self.log.warning("Culling '%s' kernel '%s' (%s) with %d connections due to %s seconds of inactivity.",
435447
kernel.execution_state, kernel.kernel_name, kernel_id, connections, idle_duration)
436448
self.shutdown_kernel(kernel_id)
437-

notebook/static/base/js/namespace.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ define(function(){
7373
// tree
7474
jglobal('SessionList','tree/js/sessionlist');
7575

76-
Jupyter.version = "5.5.0.dev0";
76+
Jupyter.version = "5.6.0.dev0";
7777
Jupyter._target = '_blank';
7878
return Jupyter;
7979
});

notebook/static/notebook/js/codecell.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ define([
160160

161161
var input = $('<div></div>').addClass('input');
162162
this.input = input;
163+
164+
var run_this_cell = $('<div></div>').addClass('run_this_cell');
165+
run_this_cell.prop('title', 'Run this cell');
166+
run_this_cell.append('<i class="fa-step-forward fa"></i>');
167+
run_this_cell.click(function (event) {
168+
event.stopImmediatePropagation();
169+
that.execute();
170+
});
171+
163172
var prompt = $('<div/>').addClass('prompt input_prompt');
164173
var inner_cell = $('<div/>').addClass('inner_cell');
165174
this.celltoolbar = new celltoolbar.CellToolbar({
@@ -180,7 +189,7 @@ define([
180189
this.code_mirror.on('keydown', $.proxy(this.handle_keyevent,this));
181190
$(this.code_mirror.getInputField()).attr("spellcheck", "false");
182191
inner_cell.append(input_area);
183-
input.append(prompt).append(inner_cell);
192+
input.append(run_this_cell).append(prompt).append(inner_cell);
184193

185194
var output = $('<div></div>');
186195
cell.append(input).append(output);
@@ -505,6 +514,7 @@ define([
505514
}
506515
this.input_prompt_number = number;
507516
var prompt_html = CodeCell.input_prompt_function(this.input_prompt_number, nline);
517+
508518
// This HTML call is okay because the user contents are escaped.
509519
this.element.find('div.input_prompt').html(prompt_html);
510520
this.events.trigger('set_dirty.Notebook', {value: true});

notebook/static/notebook/js/searchandreplace.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ define([
163163

164164
var allCellsButton = $('<button/>')
165165
.append($('<i/>').addClass('fa fa-arrows-v'))
166+
.attr('id', 'findreplace_allcells_btn')
166167
.attr('type', 'button')
167168
.addClass("btn btn-default btn-sm")
168169
.attr('data-toggle','button')
@@ -179,6 +180,7 @@ define([
179180

180181
var search = $("<input/>")
181182
.addClass('form-control input-sm')
183+
.attr('id', 'findreplace_find_inp')
182184
.attr('placeholder',i18n.msg._('Find'));
183185

184186
var findFormGroup = $('<div/>').addClass('form-group');
@@ -194,6 +196,7 @@ define([
194196
)
195197

196198
var replace = $("<input/>")
199+
.attr('id', 'findreplace_replace_inp')
197200
.addClass('form-control input-sm')
198201
.attr('placeholder',i18n.msg._('Replace'));
199202
var replaceFormGroup = $('<div/>').addClass('form-group');
@@ -354,7 +357,8 @@ define([
354357
keyboard_manager: env.notebook.keyboard_manager,
355358
buttons:{
356359
'Replace All':{ class: "btn-primary",
357-
click: function(event){onsubmit(event); return true;}
360+
click: function(event){onsubmit(event); return true;},
361+
id: "findreplace_replaceall_btn",
358362
}
359363
},
360364
open: function(){

0 commit comments

Comments
 (0)