From 356a0a9689d8da0555b0acb1ab1ba44dc184a708 Mon Sep 17 00:00:00 2001 From: Benjamin Bohard Date: Wed, 5 Aug 2020 14:28:55 +0200 Subject: [PATCH] Correction pour la passage en python 3 --- setup_main_tex_file.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/setup_main_tex_file.py b/setup_main_tex_file.py index c30cfc0..64aba7c 100755 --- a/setup_main_tex_file.py +++ b/setup_main_tex_file.py @@ -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):