Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 711f77cb authored by GARNIER Laurent's avatar GARNIER Laurent
Browse files

Revert "Merge branch 'jupyter-token_2021' into 'master'"

This reverts merge request !5
parent 0f6a73b2
No related branches found
No related tags found
1 merge request!6Revert "Merge branch 'jupyter-token_2021' into 'master'"
...@@ -2,7 +2,6 @@ import logging ...@@ -2,7 +2,6 @@ import logging
import os import os
import time import time
try: try:
from urllib.parse import urlparse, urlencode from urllib.parse import urlparse, urlencode
from urllib.request import urlopen, Request from urllib.request import urlopen, Request
...@@ -14,12 +13,8 @@ except ImportError: ...@@ -14,12 +13,8 @@ except ImportError:
import requests import requests
log = logging.getLogger('allgo') log = logging.getLogger('allgo')
# API version __version__ = '0.1.11'
__version__ = '0.2.1'
# API token for JupyterLab
API_token = None
API_token_valid = False
def local_token(): def local_token():
from os.path import expanduser from os.path import expanduser
...@@ -29,47 +24,6 @@ def local_token(): ...@@ -29,47 +24,6 @@ def local_token():
with open(filetoken) as f: with open(filetoken) as f:
return f.read() return f.read()
class Init:
"""
manage initialization of the API.
check if there is an existing token
| No: generate a temporary token and return the allgo login page
| Yes: Display "Allgo is already initialized"
"""
def __init__(self):
"""Initialization of Allgo-instance.
Parameters
----------
Returns
-------
string
allgo login page link or already initialized message
"""
# if user.is_authenticated:
# print("User authenticated")
# else:
# print("User not authenticated")
# is token valid ?
if not API_token_valid:
# Generate temp token
print("First: " + API_token+ " \n")
API_token = get_random_string(length=32)
print("____")
print("You need first to sign in with your existing https://allgo18.inria.fr/accounts/login/?token=" + API_token+ " A||GO account \n")
print("____")
else:
# FIXME : Have to check that the user is register
print("____")
msg = "A||GO already initialized\n"
print("____")
print(msg)
class App: class App:
""" """
......
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