Skip to content
Snippets Groups Projects
Commit 8eb018eb authored by Swen Vermeul's avatar Swen Vermeul
Browse files

bugfix notebook_dir: do not assume it is defined in jupyter_notebook_config.py

parent 68b3bca8
No related branches found
No related tags found
No related merge requests found
......@@ -71,6 +71,12 @@ class OpenBISConnection:
class OpenBISConnections(IPythonHandler):
def _notebook_dir(self):
notebook_dir = os.getcwd()
if 'notebook_dir' in self.config.NotebookApp:
notebook_dir = self.config.NotebookApp.notebook_dir
return notebook_dir
def post(self):
"""create a new connection
......@@ -98,7 +104,7 @@ class OpenBISConnections(IPythonHandler):
self.write({
'status' : 200,
'connections' : connections,
'notebook_dir' : self.config.NotebookApp.notebook_dir
'notebook_dir' : self._notebook_dir()
})
return
......@@ -107,6 +113,12 @@ class OpenBISConnectionHandler(IPythonHandler):
"""Handle the requests to /openbis/conn
"""
def _notebook_dir(self):
notebook_dir = os.getcwd()
if 'notebook_dir' in self.config.NotebookApp:
notebook_dir = self.config.NotebookApp.notebook_dir
return notebook_dir
def put(self, connection_name):
"""reconnect to a current connection
:return: an updated connection object
......@@ -142,11 +154,10 @@ class OpenBISConnectionHandler(IPythonHandler):
"reason": "General Network Error"
})
self.write({
'status' : 200,
'connection' : conn.get_info(),
'' : self.config.NotebookApp.notebook_dir
'' : self._notebook_dir()
})
def get(self, connection_name):
......@@ -167,7 +178,8 @@ class OpenBISConnectionHandler(IPythonHandler):
self.write({
'status' : 200,
'connection' : conn.get_info(),
'noteboook_dir' : self.config.NotebookApp.notebook_dir
'noteboook_dir' : self._notebook_dir()
})
return
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment