Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ying-Qiu Zheng
fsleyes
Commits
3cd63c37
Commit
3cd63c37
authored
Feb 24, 2021
by
Paul McCarthy
🚵
Browse files
Merge branch 'rf/notebook' into 'master'
Rf/notebook See merge request fsl/fsleyes/fsleyes!227
parents
dc78031d
10c4c3fe
Changes
4
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.rst
View file @
3cd63c37
...
...
@@ -66,6 +66,7 @@ Fixed
by default, instead of the ``mean`` underlay.
* Fixed a bug in image texture preparation for complex data types, when
running in a limited GL environment (e.g. VNC).
* Compatibility fixes for newer versions of Jupyter `notebook`.
0.34.2 (Tuesday 14th July 2020)
...
...
assets/jupyter/fsleyes_kernelmanager.py
View file @
3cd63c37
...
...
@@ -6,8 +6,6 @@
#
from
tornado
import
gen
from
notebook.services.kernels.kernelmanager
import
MappingKernelManager
...
...
@@ -25,7 +23,7 @@ class FSLeyesNotebookKernelManager(MappingKernelManager):
"""
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
FSLeyesNotebookKernelManager
,
self
).
__init__
(
*
args
,
**
kwargs
)
super
().
__init__
(
*
args
,
**
kwargs
)
def
__patch_connection
(
self
,
kernel
):
...
...
@@ -40,16 +38,14 @@ class FSLeyesNotebookKernelManager(MappingKernelManager):
kernel
.
load_connection_file
(
self
.
connfile
)
@
gen
.
coroutine
def
start_kernel
(
self
,
**
kwargs
):
async
def
start_kernel
(
self
,
**
kwargs
):
"""Overrides ``MappingKernelManager.start_kernel``. Connects
all new kernels to the IPython kernel specified by ``connfile``.
"""
kid
=
super
(
FSLeyesNotebookKernelManager
,
self
)
\
.
start_kernel
(
**
kwargs
).
result
()
kid
=
await
super
().
start_kernel
(
**
kwargs
)
kernel
=
self
.
_kernels
[
kid
]
self
.
__patch_connection
(
kernel
)
r
aise
gen
.
R
eturn
(
kid
)
return
kid
def
restart_kernel
(
self
,
*
args
,
**
kwargs
):
...
...
fsleyes/actions/notebook.py
View file @
3cd63c37
...
...
@@ -380,8 +380,12 @@ class BackgroundIPythonKernel(object):
return
self
.
__error
def
__screenshot
(
self
,
view
):
"""Insert a screenshot of the given view into the notebook. """
def
__screenshot
(
self
,
view
=
None
):
"""Insert a screenshot of the given view panel into the notebook.
If ``view`` is not specified, the first view is assumed.
"""
if
view
is
None
:
view
=
self
.
__frame
.
viewPanels
[
0
]
with
tempdir
.
tempdir
():
screenshot
.
screenshot
(
view
,
'screenshot.png'
)
return
display
.
Image
(
'screenshot.png'
)
...
...
requirements-notebook.txt
View file @
3cd63c37
...
...
@@ -2,5 +2,5 @@ pyzmq>=17.0
tornado>=5.0
ipykernel>=4.8
ipython>=5
jupyter_client>=5.
2
notebook>=
5.5
jupyter_client>=5.
3.1
notebook>=
6.0.0
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment