From f243524012a63c353075cae41b54c0cc4ba8d194 Mon Sep 17 00:00:00 2001 From: Mark Walker Date: Thu, 5 Apr 2018 07:19:24 +0000 Subject: [PATCH] Treat 'None' the same as 'undefined' in json payload --- GPX | 2 +- octoprint_GPX/iniparser.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GPX b/GPX index 56e3a48..3a397a1 160000 --- a/GPX +++ b/GPX @@ -1 +1 @@ -Subproject commit 56e3a484e0c86b5c5dff2e6332d0322b39a4c866 +Subproject commit 3a397a1bbde86793020a86cfd63b6679d5bd9019 diff --git a/octoprint_GPX/iniparser.py b/octoprint_GPX/iniparser.py index 84a617c..9e0b761 100644 --- a/octoprint_GPX/iniparser.py +++ b/octoprint_GPX/iniparser.py @@ -60,6 +60,7 @@ def update(self, ini): if not section.items: raise ValueError("Invalid section") for option, value in section.items(): + self._logger.info("option, value: %s, %s" % (option, repr(value))) if ("%s" % value) in ["True", "False"]: value = 1 if value else 0 if option == "machine_type" and (value == "" or value == "undefined"): @@ -70,7 +71,7 @@ def update(self, ini): if sectionname not in self.idx: self.idx[sectionname] = OrderedDict() line = self.idx[sectionname].get(option) - if value == '' or value == 'undefined': + if value == '' or value == 'undefined' or value == 'None': # means delete if line is not None: del self.idx[sectionname][option]