Commit 03378eab authored by vermeul's avatar vermeul
Browse files

implemented logout

parent c8009354
......@@ -63,6 +63,10 @@ class OpenBISConnection:
self.password = password
self.status = 'connected'
def logout(self):
self.openbis.logout()
self.status = "not connected"
def mount(self, username=None, password=None, hostname=None):
if username is None:
username=self.username
......@@ -231,6 +235,20 @@ class OpenBISConnectionHandler(IPythonHandler):
})
return
if data.get('action','') == 'logout':
try:
conn.logout()
self.write({
'status' : 200,
'connection' : conn.get_info(),
})
except Exception as err:
self.set_status(500)
self.write({
"reason": "logout failed: {}".format(err)
})
return
# no action given, try to connect instead
try:
......@@ -254,9 +272,9 @@ class OpenBISConnectionHandler(IPythonHandler):
})
self.write({
'status' : 200,
'connection' : conn.get_info(),
'' : self._notebook_dir()
'status' : 200,
'connection' : conn.get_info(),
'notebook_dir' : self._notebook_dir()
})
def get(self, connection_name):
......
Supports Markdown
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