This reads or sets the global settings stored in class.settings.
328486
def global_config(cls, key, *args):
        '''  '''
        if args:
            cls.settings[key] = args[0]
        else:
            return cls.settings[key]
1327368
def saveSettings(self, settings):
        
        settings.beginGroup(self.objectName())
        
        curr_prof = self.currentProfile()
        if curr_prof:
            settings.setValue('current', curr_prof.name())
        
        for profile in self.profiles():
            settings.beginGroup(profile.name())
            settings.setValue('profile', wrapVariant(profile.toString()))
            settings.endGroup()
        
        settings.endGroup()
569046
public void setSettings(java.util.Collection<OutputDestinationSettings> settings) {
        if (settings == null) {
            this.settings = null;
            return;
        }

        this.settings = new java.util.ArrayList<OutputDestinationSettings>(settings);
    }
1042670
function(settings) {
    this.events = [];
    this.setSettings(settings);
    this.bytesLoaded = 0;
    this.bytesTotal = 0;
    this.paused = !this.settings.autoStart;

    var _self = this;
    var _fileList = [];
    var _completed = new List('item.uuid');
    var _errors = new List('item.uuid');
    var _queue = new List('item.uuid');

    var onStart = function(event) {
        var e = new FileManagerEvent('file_start', {
            bytesLoaded: event.bytesLoaded,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray()
        });

        _self.dispatchEvent(e);
    };

    var onPause = function(event) {
        var e = new FileManagerEvent('file_pause', {
            bytesLoaded: event.bytesLoaded,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray()
        });

        _self.dispatchEvent(e);
    };

    var onProgress = function(event) {
        _self.bytesLoaded += event.bytesLoaded;

        // @deprecated
        var e = new FileManagerEvent('file_progress', {
            bytesLoaded: event.bytesLoaded,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray()
        });

        _self.dispatchEvent(e);

        e = new FileManagerEvent('progress', {
            bytesLoaded: event.bytesLoaded,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray()
        });

        _self.dispatchEvent(e);
    };

    var onError = function(event) {
        _queue.remove(event.target);
        _errors.add(event.target);

        // @deprecated
        var e = new FileManagerEvent('file_error', {
            bytesLoaded: 0,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray(),
            fileError: event
        });

        _self.dispatchEvent(e);

        e = new FileManagerEvent('error', {
            bytesLoaded: 0,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray(),
            fileError: event
        });

        _self.dispatchEvent(e);
        
        queue.apply(_self);
    };

    var onComplete = function(event) {
        _completed.add(event.target);
        _queue.remove(event.target);

        // @deprecated
        var e = new FileManagerEvent('file_complete', {
            bytesLoaded: event.bytesLoaded,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray(),
            data: event.data
        });

        _self.dispatchEvent(e);

        e = new FileManagerEvent('complete', {
            bytesLoaded: event.bytesLoaded,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray(),
            data: event.data
        });

        _self.dispatchEvent(e);
        
        queue.apply(_self);
    };

    _queue.add = function(item) {
        if (!!item.uuid) {
            item.on('start', onStart);
            item.on('pause', onPause);
            item.on('progress', onProgress);
            item.on('error', onError);
            item.on('complete', onComplete);

            this.list[item.uuid] = item;
            ++this.length;
        }
    };
    _queue.remove = function(item) {
        if (!!item.uuid) {
            item.off('start', onStart);
            item.off('pause', onPause);
            item.off('progress', onProgress);
            item.off('error', onError);
            item.off('complete', onComplete);

            delete this.list[item.uuid];
            --this.length;
        }
    };

    this.addFile = function(file) {
        if (!file instanceof File || !this.validate(file)) {
            // If it's an actual file, just throw it in the error queue
            if (file instanceof File) {
                _errors.add(file);
                var e = new FileManagerEvent('invalid', {
                    bytesLoaded: 0,
                    bytesTotal: file.size,
                    totalBytesLoaded: _self.bytesLoaded,
                    totalBytesTotal: _self.bytesTotal,
                    currentTarget: this,
                    queue: _queue.toArray(),
                    file: file,
                    fileList: _fileList,
                    completed: _completed.toArray(),
                    errors: _errors.toArray()
                });

                this.dispatchEvent(e);
            }
            return;
        }

        if (!_fileList) {
            _fileList = [];
        }

        _fileList.push(file);
        
        this.bytesTotal += file.size;

        // Update the queue
        queue.apply(this);

        return this;
    };

    this.setFiles = function(files) {
        if (!files instanceof FileList || !files instanceof Array || files.length === 0) {
            return;
        }

        this.pause();
        _fileList = [];
        var i;

        if (files instanceof FileList) {
            for (i = 0; i < files.length; i++) {
                this.addFile(files.item(i));
            }
        }
        else {
            for (i = 0; i < files.length; i++) {
                this.addFile(files[i]);
            }
        }

        if (this.settings.autoStart === true) {
            this.start();
        }

        return this;
    };

    var queue = function () {
        var _self = this;
        while(_queue.length < _self.settings.maxQueue && _fileList.length > 0) {
            var file = _fileList.shift();
            if (!!file) {
                // Create the FileUpload to queue
                var fu = new FileUpload(file, {
                    url: _self.settings.url,
                    method: _self.settings.method,
                    autoStart: false,
                    maxChunkSize: _self.settings.maxChunkSize,
                    formFileField: _self.settings.formFileField,
                    chunkParameter: _self.settings.chunkParameter,
                    chunksParameter: _self.settings.chunksParameter
                });

                // Update the total queue size
                _self.bytesTotal += file.size;

                // Add the uploader to the queue
                _queue.add(fu);

                // Dispatch an queue event
                _self.dispatchEvent(new FileManagerEvent('queue', {
                    bytesLoaded: 0,
                    bytesTotal: file.size,
                    totalBytesLoaded: _self.bytesLoaded,
                    totalBytesTotal: _self.bytesTotal,
                    currentTarget: fu,
                    queue: _queue.toArray(),
                    file: file,
                    fileList: _fileList,
                    completed: _completed.toArray(),
                    errors: _errors.toArray()
                }));

                // If the manager isn't paused, start the upload
                if (!_self.paused) {
                    fu.start();
                }
            }
        }
    };

    this.start = function() {
        this.paused = false;

        queue.apply(this);
        
        for (var n in _queue.list) {
            _queue.get(n).start();
        }

        this.dispatchEvent(FileManagerEvent('start', {
            bytesLoaded: this.bytesLoaded,
            bytesTotal: this.bytesTotal,
            queue: _queue.toArray(),
            fileList: _fileList,
            completed: _completed.toArray(),
            errors: _errors.toArray()
        }));
    };

    this.pause = function() {
        this.paused = true;
        for (var i = 0; i < _queue.length; i++) {
            _queue[i].pause();
        }

        this.dispatchEvent(new FileManagerEvent('pause', {
            bytesLoaded: this.bytesLoaded,
            bytesTotal: this.bytesTotal,
            queue: _queue.toArray(),
            fileList: _fileList,
            completed: _completed.toArray(),
            errors: _errors.toArray()
        }));
    };
    
    this.clearQueue = function() {
      _queue.clear();
      return this;
    };
    
    this.clearErrors = function() {
      _errors.clear();
      return this;
    };
    
    this.clearCompleted = function() {
      _completed.clear();
      return this;
    }
}
1118729
def load_config(cls):
        
        config_file = os.path.expanduser(cls.home_config)
        global_conf = cls.load(config_file, 'global')
        cls.load(cls.local_config, 'local')
        # update global configuration if needed
        cls.update_config(config_file, global_conf)
1159373
def update(cls, settings):
        """"""
        for key, val in settings.__dict__.items():
            if key.startswith('_'):
                continue
            setattr(cls, key, val)
272340
def globals(self):
        """"""
        defglobal = lib.EnvGetNextDefglobal(self._env, ffi.NULL)

        while defglobal != ffi.NULL:
            yield Global(self._env, defglobal)

            defglobal = lib.EnvGetNextDefglobal(self._env, defglobal)
561233
def read(self):
        
        logger.info("Reloading %s ..." % self.__configfile)

        # smash the previous config
        self._configparser = configparser.SafeConfigParser()
        self._configparser.read([self.__configfile])

        sections = set()
        for setting in self.settings.values():
            sections.add(setting.section)
        for section in sections:
            # make sure that all the sections exist
            if not self._configparser.has_section(section):
                self._configparser.add_section(section)

        for setting in self.settings.values():
            setting.load(self._configparser)
24557
void setDefaults(Settings defaultSettings) {

		Assert.notNull(defaultSettings, "Missing default settings!");

		for (String key : defaultSettings.keySet()) {

			CommandOption<?> option = findBySetting(key);

			if (option == null) {
				// option not present ... check next
				continue;
			}

			Object value = defaultSettings.get(key);
			option.defaultsTo(value);
		}

	}
715273
def settings(self):
        
        settings_file = os.path.join(os.getcwd(), 'settings', self.module.lower() + '.ini')

        # Loads the settings file once.
        if (not hasattr(self, '_settings') or self._settings is None) and os.path.isfile(settings_file):
            config = ConfigParser.ConfigParser()
            config.read(settings_file)

            settings = dict(config._sections)
            for key in settings:
                settings[key] = dict(config.defaults(), **settings[key])
                settings[key].pop('__name__', None)

            self._settings = SettingsDict(self, settings.get(self.name, {}))

        elif not hasattr(self, '_settings'):
            self._settings = SettingsDict(self, {})

        return self._settings
1013099
def load_settings(self, settings):
        """"""
        with open(settings) as settings_file:
            settings_dict = simplejson.load(settings_file)
        for key, value in settings_dict.items():
            self.__setattr__(key, value)
928038
public function settings(array $settings = null)
    {
        if ($settings !== null) {
            $this->settings = $settings;
        }

        return $this->settings + static::$globalSettings;
    }
901760
public String getGlobalSetting(GlobalSettingKey key) {
        if (globalSettings.containsKey(key.toString()))
            return globalSettings.get(key.toString());
        return key.getDefault();
    }
635101
def process_settings(self, settings):
        """"""
        logging.debug("Using configuration from: %s", settings.name)
        exec(compile(settings.read(), settings.name, 'exec'), globals(), locals())
1293465
def load():
    
    config = ConfigParser.RawConfigParser(DEFAULTS)
    config.readfp(open(CONF_PATH))
    for section in config.sections():
        globals()[section] = {}
        for key, val in config.items(section):
            globals()[section][key] = val
718909
def explode_global_conf(self):
        
        for cls, _, strclss, _, _ in list(self.types_creations.values()):
            logger.debug("Applying global conf for the class '%s'...", strclss)
            cls.load_global_conf(self)
1047769
def initialise():
    
    global settings, project_settings

    # Global changes settings
    settings = Changes.load()

    # Project specific settings
    project_settings = Project.load(GitHubRepository(auth_token=settings.auth_token))