Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
openbis
openbis-public
jupyter
jupyter-openbis-gui-server
Commits
03378eab
Commit
03378eab
authored
Jun 16, 2020
by
vermeul
Browse files
implemented logout
parent
c8009354
Changes
1
Hide whitespace changes
Inline
Side-by-side
jupyter-openbis-server/connection.py
View file @
03378eab
...
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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