Fix an issue with global_get from 3rd party plugins

This commit is contained in:
Gina Häußge 2016-08-17 14:50:53 +02:00
parent 217e54d81c
commit 74a94469b6

View file

@ -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]