MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / __init__

Method __init__

src/octoprint/settings.py:198–222  ·  view source on GitHub ↗
(self, configfile=None, basedir=None)

Source from the content-addressed store, hash-verified

196class Settings(object):
197
198 def __init__(self, configfile=None, basedir=None):
199 self._logger = logging.getLogger(__name__)
200
201 self.settings_dir = None
202
203 self._config = None
204 self._dirty = False
205 self._saveLock = threading.Lock()
206
207 if configfile is not None:
208 self._configfile = configfile
209
210 else:
211 if basedir:
212 settings_dir = basedir
213 else:
214 settings_dir = os.path.realpath(os.path.dirname(__file__)+'/../../local')
215
216 self._configfile = os.path.join(settings_dir, "config.yaml")
217
218 self._init_settings_dir(basedir)
219
220 self._factoryConfigFile = os.path.join(os.path.dirname(self._configfile), "config.factory")
221
222 self.load()
223
224 def _init_settings_dir(self, basedir):
225 if basedir is not None:

Callers

nothing calls this directly

Calls 3

_init_settings_dirMethod · 0.95
loadMethod · 0.95
joinMethod · 0.80

Tested by

no test coverage detected