mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2025-06-28 14:25:12 +00:00
Add setup.py to allow local pip installs of tfw
This commit is contained in:
12
lib/envvars/__init__.py
Normal file
12
lib/envvars/__init__.py
Normal file
@ -0,0 +1,12 @@
|
||||
# Copyright (C) 2018 Avatao.com Innovative Learning Kft.
|
||||
# All Rights Reserved. See LICENSE file for details.
|
||||
|
||||
from collections import namedtuple
|
||||
from os import environ
|
||||
|
||||
|
||||
def prefixed_envvars_to_namedtuple(prefix: str, tuple_name: str):
|
||||
envvars = {envvar.replace(prefix, '', 1): environ.get(envvar)
|
||||
for envvar in environ.keys()
|
||||
if envvar.startswith(prefix)}
|
||||
return namedtuple(tuple_name, envvars)(**envvars)
|
Reference in New Issue
Block a user