[refactor]

This commit is contained in:
Martin Muehlhaeuser 2018-08-14 23:34:06 +00:00
parent a03cc70539
commit 91171d40b6
1 changed files with 3 additions and 8 deletions

View File

@ -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"]))
@ -286,11 +286,6 @@ class KlipperPlugin(
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(