Commit 007120de authored by Sebastian's avatar Sebastian

ipython_notebook: update slapos to install the jiocontents extension

parent 04c27ca1
...@@ -8,11 +8,13 @@ extends = ...@@ -8,11 +8,13 @@ extends =
../../component/pandas/buildout.cfg ../../component/pandas/buildout.cfg
../../component/openssl/buildout.cfg ../../component/openssl/buildout.cfg
../../component/seaborn/buildout.cfg ../../component/seaborn/buildout.cfg
../../component/git/buildout.cfg
../../stack/monitor/buildout.cfg ../../stack/monitor/buildout.cfg
parts = parts =
slapos-cookbook slapos-cookbook
ipython-notebook ipython-notebook
instance-jupyter instance-jupyter
jiocontents-nbextension
[ipython-notebook] [ipython-notebook]
; In the ipython notebook software, we use more eggs than in the minimal ; In the ipython notebook software, we use more eggs than in the minimal
...@@ -37,7 +39,7 @@ mode = 0644 ...@@ -37,7 +39,7 @@ mode = 0644
[ipython-notebook-config] [ipython-notebook-config]
<= download-file-base <= download-file-base
filename = ipython_notebook_config.py.jinja filename = ipython_notebook_config.py.jinja
md5sum = 95a76a80718e2a933dd4854dcf9a4a65 md5sum = 66b547e099cd280c7e51e3e8c17e72e2
[ipython-notebook-set-password] [ipython-notebook-set-password]
<= download-file-base <= download-file-base
...@@ -59,6 +61,13 @@ md5sum = ab6e78ea20855e07d388b5b86d1770fe ...@@ -59,6 +61,13 @@ md5sum = ab6e78ea20855e07d388b5b86d1770fe
filename = custom.js.jinja filename = custom.js.jinja
md5sum = 13561a9d86c488be752795e7bc23474a md5sum = 13561a9d86c488be752795e7bc23474a
[jiocontents-nbextension]
recipe = slapos.recipe.build:gitclone
git-executable = ${git:location}/bin/git
repository = https://lab.nexedi.com/Kreisel/jiocontents-nbextension.git
branch = master
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[instance-jupyter] [instance-jupyter]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg.in template = ${:_profile_base_location_}/instance.cfg.in
...@@ -82,6 +91,8 @@ context = ...@@ -82,6 +91,8 @@ context =
key custom_js_location custom-js:location key custom_js_location custom-js:location
key custom_js_filename custom-js:filename key custom_js_filename custom-js:filename
key monitor_template_rendered buildout:directory key monitor_template_rendered buildout:directory
# JIOCONTENTS-NBEXTENSION
key jiocontents_nbextension_location jiocontents-nbextension:location
[versions] [versions]
Pygments = 2.2.0 Pygments = 2.2.0
......
...@@ -34,5 +34,28 @@ if not parser.has_option("ipython_notebook", "password") or \ ...@@ -34,5 +34,28 @@ if not parser.has_option("ipython_notebook", "password") or \
c.NotebookApp.password = passwd(parser.get("ipython_notebook", "password")) c.NotebookApp.password = passwd(parser.get("ipython_notebook", "password"))
#
# START CUSTOM JIO CONTENTS MANAGER
#
from notebook.services.contents.manager import ContentsManager
class ClientSideContentsManager(ContentsManager):
def dir_exists(self, path):
return True
def is_hidden(self, path):
return False
def file_exists(self, path=''):
return True
def get(self, path, content=True, type=None, format=None):
return {'type':'notebook'}
c.NotebookApp.tornado_settings = {'contents_js_source': 'nbextensions/jiocontents/jiocontents'}
c.NotebookApp.contents_manager_class = ClientSideContentsManager
#
# END JIO CONTENTS MANAGER
#
with open(knowledge_0, 'w') as file: with open(knowledge_0, 'w') as file:
parser.write(file) parser.write(file)
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment