From 64e60343bfa3db9907d478381d70635d05c48c62 Mon Sep 17 00:00:00 2001 From: Maxime Alves LIRMM Date: Tue, 20 Oct 2020 09:23:11 +0200 Subject: [PATCH] =?UTF-8?q?[conf]=C2=A0Clean=20of=20DOMAINS=20global=20var?= =?UTF-8?q?iable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- halfapi/cli/domain.py | 6 +++--- halfapi/conf.py | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/halfapi/cli/domain.py b/halfapi/cli/domain.py index fae9f66..e7abc06 100644 --- a/halfapi/cli/domain.py +++ b/halfapi/cli/domain.py @@ -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 diff --git a/halfapi/conf.py b/halfapi/conf.py index 81ad4c5..5f7b16d 100644 --- a/halfapi/conf.py +++ b/halfapi/conf.py @@ -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'