From d53d7967a1500fd1b2756d4e6bcdd09c0a492da8 Mon Sep 17 00:00:00 2001 From: OllisGit Date: Wed, 7 Oct 2020 10:51:15 +0200 Subject: [PATCH] New Version 1.6.1 - B #5 export with python 3 --- octoprint_filamentmanager/api/__init__.py | 10 +++++++--- setup.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/octoprint_filamentmanager/api/__init__.py b/octoprint_filamentmanager/api/__init__.py index deccb62..da850b3 100644 --- a/octoprint_filamentmanager/api/__init__.py +++ b/octoprint_filamentmanager/api/__init__.py @@ -323,9 +323,13 @@ def export_data(self): archive_name = "filament_export_{timestamp}.zip".format(timestamp=timestamp) def file_generator(): - with open(archive_path) as f: - for c in f: - yield c + with open(archive_path, "rb") as f: + while True: + chunk = f.read() + if chunk: + yield(chunk) + else: + break try: os.remove(archive_path) except Exception as e: diff --git a/setup.py b/setup.py index 2bc946e..82ee0a3 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ plugin_identifier = "filamentmanager" plugin_package = "octoprint_filamentmanager" plugin_name = "OctoPrint-FilamentManager" -plugin_version = "1.6.0" +plugin_version = "1.6.1" plugin_description = "Manage your spools and keep track of remaining filament on them" plugin_author = "Sven Lohrmann, Olli" plugin_author_email = "ollisgit@gmail.com, malnvenshorn@gmail.com"