Add setup.py to allow local pip installs of tfw

This commit is contained in:
Kristóf Tóth
2018-05-10 15:57:36 +02:00
parent d67d2c6bc9
commit 1fb13fefff
3 changed files with 21 additions and 1 deletions

12
lib/envvars/__init__.py Normal file
View 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)