Correction pour la passage en python 3

This commit is contained in:
Benjamin Bohard 2020-08-05 14:28:55 +02:00
parent 00ff5356c9
commit 356a0a9689
1 changed files with 9 additions and 9 deletions

View File

@ -58,27 +58,27 @@ def main():
name = args.name
if name:
if path.splitext(name)[1] == '':
name = name.decode('utf-8') + u'.tex'
name = name + '.tex'
else:
name = get_unique_name('formation')
title = args.title
if not title:
title = u'FIXME'
title = 'FIXME'
else:
title = title.decode('utf-8')
title = title
author = args.author
if not author:
author = u'Cadoles'
author = 'Cadoles'
else:
author = author.decode('utf-8')
author = author
client = args.client
if not client:
client = u'FIXME'
client = 'FIXME'
else:
client = client.decode('utf-8')
client = client
directory = args.directory
if not directory:
@ -118,7 +118,7 @@ def main():
makedirs(directory)
template_dest_name = name if template_file == master else template_file
with open(path.join(directory, template_dest_name), 'w') as rendered_file:
rendered_file.write(rendered_template.encode('utf-8'))
rendered_file.write(rendered_template)
def update(args):
"""
@ -151,7 +151,7 @@ def main():
'name': dest}
rendered_template = template.render(**env)
with open(dest, 'w') as rendered_file:
rendered_file.write(rendered_template.encode('utf-8'))
rendered_file.write(rendered_template)
def outline(args):