Loading of settings needed for the app
Called if it's the first time or user need update of settings
165936
public function loadSettingDefaults(array $fields, $user)
    {
        $user = $this->container->get('security.context')->getToken()->getUser();

        foreach($fields as $field){
            if (!$this->getSetting($field['setting_key'], $field['focus'], $user)) {
                if(!isset($field['default_value'])) {
                    $field['default_value'] = '';
                }
                $this->setSetting($field['setting_key'], $field['focus'], $field['default_value'], $field['context'], $user);
            }
        }

        //TODO: Increment schema_version setting
    }
869779
function() {
      // Remember the current page state
      var t = this;
      t.pageSettingsView.originalModel = t.model.toJSON({trim:false});

      // Load & show the dialog
      t.showDialog('#nm-pv-settings');
    }
897354
def init_app(self, app):
        

        for k, v in DEFAULT_SETTINGS.items():
            app.config.setdefault(k, v)

        if app.debug and not get_setting('FLASKS3_DEBUG', app):
            app.config['FLASKS3_ACTIVE'] = False

        if get_setting('FLASKS3_ACTIVE', app):
            app.jinja_env.globals['url_for'] = url_for
        if get_setting('FLASKS3_USE_CACHE_CONTROL', app) and app.config.get('FLASKS3_CACHE_CONTROL'):
            cache_control_header = get_setting('FLASKS3_CACHE_CONTROL', app)
            app.config['FLASKS3_HEADERS']['Cache-Control'] = cache_control_header
87530
def __load_settings(self):
        
        #file_path = path.relpath(settings_file_path)
        #file_path = path.abspath(settings_file_path)
        file_path = self.file_path

        try:
            self.data = json.load(open(file_path))
        except FileNotFoundError:
            print("Could not load", file_path)
607850
private function loadSettings()
    {
        $filename = $this->basedir . '/Settings.php';

        // Check for settings file
        if (!file_exists($filename) || !is_readable($filename)) {
            Throw new FrameworkException('Settings file could not be loaded. Make sure Settings.php exits in projects root dir and is readable.');
        }

        // Load basic config from Settings.php
        $this->settings = include ($filename);

        if (!empty($this->settings['display_errors'])) {
            ini_set('display_errors', 0);
        }
    }
203366
def _reload(self):
        
        ConfigModel = apps.get_model('djconfig.Config')
        cache = {}
        data = dict(
            ConfigModel.objects
                .all()
                .values_list('key', 'value'))

        # populate cache with initial form values,
        # then with cleaned database values,
        # then with raw database file/image paths
        for form_class in self._registry:
            empty_form = form_class()
            cache.update({
                name: field.initial
                for name, field in empty_form.fields.items()})
            form = form_class(data={
                name: _deserialize(data[name], field)
                for name, field in empty_form.fields.items()
                if name in data and not isinstance(field, forms.FileField)})
            form.is_valid()
            cache.update({
                name: _unlazify(value)
                for name, value in form.cleaned_data.items()
                if name in data})
            # files are special because they don't have an initial value
            # and the POSTED data must contain the file. So, we keep
            # the stored path as is
            # TODO: see if serialize/deserialize/unlazify can be used for this instead
            cache.update({
                name: data[name]
                for name, field in empty_form.fields.items()
                if name in data and isinstance(field, forms.FileField)})

        cache['_updated_at'] = data.get('_updated_at')
        self._cache = cache
1012598
def update(self, settings):
        """"""
        self.settings.cache_clear()
        self._settings = settings
        log.info("Updated settings to %s", self._settings)
        self._update_disabled_plugins()
852418
def on_load(self, event):
        ''''''
        dlg = wx.FileDialog(None, self.settings.get_title(), '', "", '*.*', wx.FD_OPEN)
        if dlg.ShowModal() == wx.ID_OK:
            self.settings.load(dlg.GetPath())
        # update the controls with new values
        for label in self.setting_map.keys():
            setting = self.setting_map[label]
            ctrl = self.controls[label]
            value = ctrl.GetValue()
            if isinstance(value, str) or isinstance(value, unicode):
                ctrl.SetValue(str(setting.value))
            else:
                ctrl.SetValue(setting.value)
1193429
function(value) {
			var self = this;
			var fn = self.settings.load;
			if (!fn) return;
			if (self.loadedSearches.hasOwnProperty(value)) return;
			self.loadedSearches[value] = true;
			self.load(function(callback) {
				fn.apply(self, [value, callback]);
			});
		}
764127
def reload(self):
        
        self.load(self.api.get(self.objName, self.key))
755721
def _load_hooks_settings(self):
        """"""
        log.debug("executing _load_hooks_settings")
        hook_show_widget = self.get_widget("hook_show")
        hook_show_setting = self.settings.hooks.get_string("show")
        if hook_show_widget is not None:
            if hook_show_setting is not None:
                hook_show_widget.set_text(hook_show_setting)
173628
protected void beforeLoading()
    {
        if (_listeners != null)
        {
            CollectionProxyListener listener;

            if (_perThreadDescriptorsEnabled) {
                loadProfileIfNeeded();
            }
            for (int idx = _listeners.size() - 1; idx >= 0; idx--)
            {
                listener = (CollectionProxyListener)_listeners.get(idx);
                listener.beforeLoading(this);
            }
        }
    }
1141583
def init_app(self, app):
        """"""
        assert 'zodb' not in app.extensions, \
               'app already initiated for zodb'
        app.extensions['zodb'] = _ZODBState(self, app)
        app.teardown_request(self.close_db)
493854
def update(self, settings):
        '''
        

        '''
        if 'settings' in settings:
            self._settings.update(settings['settings'])
        else:
            self._settings.update(settings)

        if 'instruments' in settings:
            for instrument_name, instrument_setting in settings['instruments'].items():
                self.instruments[instrument_name]['settings'].update(instrument_setting['settings'])

        if 'scripts' in settings:
            for script_name, script_setting in settings['scripts'].items():
                self.scripts[script_name].update(script_setting)
970392
def init_app(self, app):
        """"""
        # Ensure SECRET_KEY is set.
        SECRET_KEY = app.config.get('SECRET_KEY')

        if SECRET_KEY is None:
            app.config['SECRET_KEY'] = 'CHANGE_ME'
            warnings.warn(
                'Set configuration variable SECRET_KEY with random string',
                UserWarning)
426436
function () {
			if (!this._oViewSettings) {

				// init the view settings
				this._initViewSettings();

				// apply app settings
				this.getOwnerComponent().getEventBus().publish("app", "applyAppConfiguration", {
					themeActive: this._oViewSettings.themeActive,
					compactOn: this._oViewSettings.compactOn
				});

			}
		}
1339037
def refresh(self):
        """"""
        # Update core device data
        new_device_json = self._device_request()
        _LOGGER.debug("Device Refresh Response: %s", new_device_json)

        # Update avatar url
        new_avatar_json = self._avatar_request()
        _LOGGER.debug("Avatar Refresh Response: %s", new_avatar_json)

        # Update device detail info
        new_info_json = self._info_request()
        _LOGGER.debug("Device Info Refresh Response: %s", new_info_json)

        # Update device setting details
        new_settings_json = self._settings_request()
        _LOGGER.debug("Device Settings Refresh Response: %s",
                      new_settings_json)

        # Update the stored data
        self.update(new_device_json, new_info_json, new_settings_json,
                    new_avatar_json)

        # Update the activities
        self._update_activities()