mirror of
https://github.com/PokeAPI/pokeapi
synced 2025-02-16 20:48:25 +00:00
try: use env var
This commit is contained in:
parent
88603b36ca
commit
c2a781e5de
1 changed files with 2 additions and 2 deletions
|
@ -30,7 +30,7 @@ DB_CURSOR = connection.cursor()
|
||||||
DB_VENDOR = connection.vendor
|
DB_VENDOR = connection.vendor
|
||||||
|
|
||||||
|
|
||||||
MEDIA_DIR = "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/{0}"
|
MEDIA_DIR = "{prefix}{{file_name}}".format(prefix=os.environ.get("POKEAPI_SPRITES_PREFIX", "/media/sprites/"))
|
||||||
IMAGE_DIR = os.getcwd() + "/data/v2/sprites/sprites/"
|
IMAGE_DIR = os.getcwd() + "/data/v2/sprites/sprites/"
|
||||||
RESOURCE_IMAGES = []
|
RESOURCE_IMAGES = []
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ for root, dirs, files in os.walk(IMAGE_DIR):
|
||||||
|
|
||||||
|
|
||||||
def file_path_or_none(file_name):
|
def file_path_or_none(file_name):
|
||||||
return MEDIA_DIR.format(file_name) if file_name in RESOURCE_IMAGES else None
|
return MEDIA_DIR.format(file_name=file_name) if file_name in RESOURCE_IMAGES else None
|
||||||
|
|
||||||
|
|
||||||
def with_iter(context, iterable=None):
|
def with_iter(context, iterable=None):
|
||||||
|
|
Loading…
Add table
Reference in a new issue