Files
mayan-edms/docs/utils.py
Roberto Rosario 15dc4e8489 Organize global substitution code
Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
2019-11-11 18:33:26 -04:00

22 lines
496 B
Python

from __future__ import unicode_literals
def load_env_file(filename='../config.env'):
result = {}
with open(filename) as file_object:
for line in file_object:
if not line.startswith('#'):
key, value = line.strip().split('=')
result[key] = value
return result
def generate_substitutions(dictionary):
result = []
for key, value in dictionary.items():
result.append(('|{}|'.format(key), value))
return result