From 91171d40b696ac6d224254eea5186a563c6005d0 Mon Sep 17 00:00:00 2001 From: Martin Muehlhaeuser Date: Tue, 14 Aug 2018 23:34:06 +0000 Subject: [PATCH] [refactor] --- octoprint_klipper/__init__.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/octoprint_klipper/__init__.py b/octoprint_klipper/__init__.py index 6e5f664..375fbe6 100644 --- a/octoprint_klipper/__init__.py +++ b/octoprint_klipper/__init__.py @@ -87,11 +87,11 @@ class KlipperPlugin( filepath = os.path.expanduser( self._settings.get(["configuration", "path"]) ) - f = open(filepath) + f = open(filepath, "w") f.write(data["config"]) f.close() self._logger.info( - "Write Klipper config to {}".format(filepath) + "Writing Klipper config to {}".format(filepath) ) # Restart klipply to reload config self._printer.commands(self._settings.get(["configuration", "reload_command"])) @@ -285,12 +285,7 @@ class KlipperPlugin( kc = Parser() sections = kc.load(data["configFile"]) return flask.jsonify(sections) - - def on_api_get(self, request): - log_analyzer = KlipperLogAnalyzer.KlipperLogAnalyzer("/tmp/klippy.log.2018-08-06") - - return log_analyzer.analyze() - + def get_update_information(self): return dict( klipper=dict(