From cd465aa9a6a9b9ebf1adbb60c3411cad08f1effd Mon Sep 17 00:00:00 2001 From: Jean-Luc Parouty <Jean-Luc.Parouty@simap.grenoble-inp.fr> Date: Wed, 3 Nov 2021 11:51:47 +0100 Subject: [PATCH] Update coocki for Windows compatibility --- fidle/config.py | 2 +- fidle/cookci.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fidle/config.py b/fidle/config.py index b6f2563..43bf23d 100644 --- a/fidle/config.py +++ b/fidle/config.py @@ -14,7 +14,7 @@ # ---- Version ----------------------------------------------------- # -VERSION = '2.0.27' +VERSION = '2.0.28' # ---- Default notebook name --------------------------------------- # diff --git a/fidle/cookci.py b/fidle/cookci.py index 05a8204..1bf5026 100644 --- a/fidle/cookci.py +++ b/fidle/cookci.py @@ -12,7 +12,7 @@ # A simple module to run all notebooks with parameters overriding # Jean-Luc Parouty 2021 -import sys,os +import sys,os,platform import json import datetime, time import nbformat @@ -30,7 +30,7 @@ sys.path.append('..') import fidle.config as config import fidle.cookindex as cookindex -VERSION = '1.2' +VERSION = '1.4.1' start_time = {} end_time = {} @@ -77,7 +77,7 @@ def run_profile(profile_name, reset=False, filter=r'.*', top_dir='..'): # ---- Report file -------------------------------------------------------- # metadata = config - metadata['host'] = os.uname()[1] + metadata['host'] = platform.uname()[1] metadata['profile'] = profile_name report_json = top_dir + '/' + config['report_json' ] @@ -223,8 +223,8 @@ def run_profile(profile_name, reset=False, filter=r'.*', top_dir='..'): # ---- Save save_dir = os.path.abspath( f'{top_dir}/{output_html}/{notebook_dir}' ) os.makedirs(save_dir, mode=0o750, exist_ok=True) - with open( f'{save_dir}/{output_name}.html', mode='w') as fp: - fp.write(body_html) + with open( f'{save_dir}/{output_name}.html', mode='wb') as fp: + fp.write(body_html.encode("utf-8")) print(f' - Saved {save_dir}/{output_name}.html') # ---- Clean all ------------------------------------------------------ -- GitLab