From 067b8151006e73e6846e96b2613044e8ed10d977 Mon Sep 17 00:00:00 2001 From: Sergey Vartanov Date: Sat, 25 Sep 2021 07:49:30 +0300 Subject: [PATCH] Issue #89: fix SVG encoding; remove progress bar. --- map_machine/mapper.py | 2 +- map_machine/ui.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/map_machine/mapper.py b/map_machine/mapper.py index d8046cf..6f29225 100644 --- a/map_machine/mapper.py +++ b/map_machine/mapper.py @@ -280,5 +280,5 @@ def ui(arguments: argparse.Namespace) -> None: painter.draw(constructor) logging.info(f"Writing output SVG to {arguments.output_file_name}...") - with open(arguments.output_file_name, "w") as output_file: + with open(arguments.output_file_name, "w", encoding="utf-8") as output_file: svg.write(output_file) diff --git a/map_machine/ui.py b/map_machine/ui.py index 155d32b..3f1510c 100644 --- a/map_machine/ui.py +++ b/map_machine/ui.py @@ -301,6 +301,9 @@ def progress_bar( subsequently) :param text: short description """ + if number == 0: + sys.stdout.write(text + "...\n") + return if number == -1: sys.stdout.write(f"100 % {length * '█'}▏{text}\n") elif number % step == 0: