abs path fix

This commit is contained in:
Charlie Jacomme 2018-08-09 16:07:39 +02:00
parent 0e1b09cc32
commit a6edbfc4ff

View file

@ -30,12 +30,12 @@ def generate(api_client):
all_users = api_client.list("localemail/users") all_users = api_client.list("localemail/users")
# Création de l'environnement Jinja # Création de l'environnement Jinja
env = Environment(loader=FileSystemLoader('.')) env = Environment(loader=FileSystemLoader('.'))
template = env.get_template('templates/list') template = env.get_template(path+'\templates/list')
aliases_rendered = template.render(data=all_users) aliases_rendered = template.render(data=all_users)
fichier = open(path+'/generated/aliases','w') fichier = open(path+'/generated/aliases','w')
if os.path.isfile('aliases_local'): # if a local aliases file exist, add it's content at the beginning if os.path.isfile(path+'/aliases_local'): # if a local aliases file exist, add it's content at the beginning
local = open(path+'/aliases_local','r') local = open(path+'/aliases_local','r')
for line in local.readlines(): for line in local.readlines():
fichier.write(line) fichier.write(line)