From 7fdf4f9ee94cc1ec356b609cca6e6de00a322299 Mon Sep 17 00:00:00 2001 From: "Emmanuel I. Obi" Date: Thu, 4 Jan 2024 12:14:48 -0600 Subject: [PATCH] moves BASE_URL to centrally-located pokedex.constants module --- pokedex/api/client.py | 2 +- pokedex/api/constants.py | 1 - pokedex/constants.py | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 pokedex/api/constants.py diff --git a/pokedex/api/client.py b/pokedex/api/client.py index a034ec8..be4f009 100644 --- a/pokedex/api/client.py +++ b/pokedex/api/client.py @@ -6,10 +6,10 @@ from actionpack.utils import Closure from pokedex.api import PokeApiEndpoints, Pokemon -from pokedex.api.constants import BASE_URL from pokedex.api.models import PokeApiResource, PokeApiResourceRef, PokemonRef from pokedex.api.request import ApiRequest from pokedex.api.request.protocol import DeferredRequest +from pokedex.constants import BASE_URL ApiRequestType = ApiRequest.type() diff --git a/pokedex/api/constants.py b/pokedex/api/constants.py deleted file mode 100644 index e4d73e7..0000000 --- a/pokedex/api/constants.py +++ /dev/null @@ -1 +0,0 @@ -BASE_URL = "https://pokeapi.co/api/v2/" diff --git a/pokedex/constants.py b/pokedex/constants.py index 2a28d01..2d347f0 100644 --- a/pokedex/constants.py +++ b/pokedex/constants.py @@ -6,4 +6,6 @@ DBROOT = PROJECTROOT / "pokedex" / "db" CACHEPATH = DBROOT / "cache" +BASE_URL = "https://pokeapi.co/api/v2/" + API_REQUEST_IMPL = environ.get("API_REQUEST_IMPL") or "DEFAULT"