From 74a94469b6137aff09d901d48ce11df4bc40afb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 17 Aug 2016 14:50:53 +0200 Subject: [PATCH] Fix an issue with global_get from 3rd party plugins --- src/octoprint/settings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index 830112f1..c99fba5f 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -46,7 +46,7 @@ def settings(init=False, basedir=None, configfile=None): (False, default). If this is set to True and the plugin manager has already been initialized, a :class:`ValueError` will be raised. The same will happen if the plugin manager has not yet been initialized and this is set to False. - basedir (str): Path of the base directoy for all of OctoPrint's settings, log files, uploads etc. If not set + basedir (str): Path of the base directory for all of OctoPrint's settings, log files, uploads etc. If not set the default will be used: ``~/.octoprint`` on Linux, ``%APPDATA%/OctoPrint`` on Windows and ``~/Library/Application Support/OctoPrint`` on MacOS. configfile (str): Path of the configuration file (``config.yaml``) to work on. If not set the default will @@ -874,9 +874,9 @@ class Settings(object): while len(path) > 1: key = path.pop(0) - if key in config and key in defaults: + if key in config: config = config[key] - defaults = defaults[key] + defaults = defaults.get(key, dict()) elif incl_defaults and key in defaults: config = {} defaults = defaults[key]