Add packages in setup.cfg

This commit is contained in:
Yohan Boniface 2019-03-24 16:13:37 +01:00
parent 2eaac8cf17
commit ce8003114d
2 changed files with 6 additions and 1 deletions

View file

@ -178,15 +178,19 @@ def upload_env():
"COPANIER_SMTP_LOGIN": None, "COPANIER_SMTP_LOGIN": None,
} }
content = "" content = ""
table = str.maketrans({'"': r"\""})
for key, value in vars_.items(): for key, value in vars_.items():
value = value or os.environ[key]
try: try:
content += "{}={}\n".format(key, value or os.environ[key]) content += f'{key}="{str(value).translate(table)}"\n'
except KeyError: except KeyError:
sys.exit(f"The {key} environment variable does not exist.") sys.exit(f"The {key} environment variable does not exist.")
path = "/srv/copanier/env" path = "/srv/copanier/env"
if exists(path): if exists(path):
run(f"cat {path}") run(f"cat {path}")
put(StringIO(content), path) put(StringIO(content), path)
if exists(path):
run(f"cat {path}")
@minicli.wrap @minicli.wrap

View file

@ -3,6 +3,7 @@ name = copanier
version = 0.0.1 version = 0.0.1
[options] [options]
packages = find:
install_requires = install_requires =
Jinja2==2.10 Jinja2==2.10
minicli==0.4.4 minicli==0.4.4