Compare commits

...

4 Commits

Author SHA1 Message Date
Maxime Alves LIRMM@home e121504e49 Merge branch 'devel_' of gite.lirmm.fr:malves/halfapi into devel_ 2020-10-27 10:11:06 +01:00
Maxime Alves LIRMM@home 8bfdc8f428 changed logger to uvicorn 2020-10-27 10:10:35 +01:00
Maxime Alves LIRMM e4fb3b8bb1 [conf] Clean of DOMAINS global variable 2020-10-20 09:26:39 +02:00
Maxime Alves LIRMM 1cd1bd74a1 logging 2020-10-20 09:09:21 +02:00
3 changed files with 4 additions and 6 deletions

View File

@ -10,7 +10,7 @@ import click
from .cli import cli
from ..conf import config, write_config, DOMAINS, DOMAINSDICT
from ..conf import config, write_config, DOMAINSDICT
from ..lib.schemas import schema_dict_dom
@ -84,11 +84,11 @@ def domain(domains, delete, update, create, read): #, domains, read, create, up
# TODO: Connect to the create_domain function
raise NotImplementedError
domains = DOMAINS
domains = DOMAINSDICT().keys()
else:
domains_ = []
for domain_name in domains.split(','):
if domain_name in DOMAINS:
if domain_name in DOMAINSDICT().keys():
domains_.append(domain_name)
continue

View File

@ -10,7 +10,6 @@ It uses the following environment variables :
It defines the following globals :
- PROJECT_NAME (str)
- DOMAINS ([]) - seems to be unused except in this file
- DOMAINSDICT ({domain_name: domain_module})
- PRODUCTION (bool)
- BASE_DIR (str)
@ -46,7 +45,6 @@ from .lib.domain import d_domains
logger = logging.getLogger('halfapi')
PROJECT_NAME = os.path.basename(os.getcwd())
DOMAINS = []
DOMAINSDICT = lambda: {}
PRODUCTION = False
HOST = '127.0.0.1'

View File

@ -8,7 +8,7 @@ import logging
from types import ModuleType
from typing import Generator, Dict, List
logger = logging.getLogger("halfapi")
logger = logging.getLogger("uvicorn.asgi")
VERBS = ('GET', 'POST', 'PUT', 'PATCH', 'DELETE')