Save each of the settings to the DB.
178397
def save(self):
        
        active_language = get_language()
        for (name, value) in self.cleaned_data.items():
            if name not in registry:
                name, code = name.rsplit('_modeltranslation_', 1)
            else:
                code = None
            setting_obj, created = Setting.objects.get_or_create(name=name)
            if settings.USE_MODELTRANSLATION:
                if registry[name]["translatable"]:
                    try:
                        activate(code)
                    except:
                        pass
                    finally:
                        setting_obj.value = value
                        activate(active_language)
                else:
                    # Duplicate the value of the setting for every language
                    for code in OrderedDict(settings.LANGUAGES):
                        setattr(setting_obj,
                                build_localized_fieldname('value', code),
                                value)
            else:
                setting_obj.value = value
            setting_obj.save()
236678
def save_config(self, cmd="write", confirm=False, confirm_response=""):
        """"""
        return super(IpInfusionOcNOSBase, self).save_config(
            cmd=cmd, confirm=confirm, confirm_response=confirm_response
        )
307447
private function _saveRecords()
    {
        $offset = 50;
        if (is_array($this->records) && (count($this->records) > 0)) {
            foreach ($this->records as $index => $record) {
                //Save the record to the .shp file
                $record->saveToFile($this->SHPFile, $this->DBFFile, $index + 1);

                //Save the record to the .shx file
                fwrite($this->SHXFile, pack('N', $offset));
                fwrite($this->SHXFile, pack('N', $record->getContentLength()));
                $offset += (4 + $record->getContentLength());
            }
        }
    }
726960
def save(self):
        """"""
        files = [f.depotFile for f in self._files]
        cmd = ['reopen', '-c', 'default']
        self._connection.run(cmd + files)
        self._dirty = False
437332
public function save()
    {
        $host = $this;
        array_map(function ($value) use ($host) {
            $host->saveSubset($value);
        }, $this->fileBasedSubsets);
    }
947297
def save_db(self):
        
        with self.db_mutex:
            if not isinstance(self.db, dict) and not isinstance(self.db, list):
                return False
            try:
                with open(self.json_db_path, "w") as fp:
                    json.dump(self.db, fp, indent=4)
            except Exception as e:
                # disk full or something.
                _logger.debug("*** Write JSON DB to file error.")
                raise e

            else:
                self.sync()
                return True
89335
def save_metadata(self, profile="default"):
        """"""
        if len(self.tables) > 0:
            f = profile_path(DBPY_PROFILE_ID, profile)
            dump_to_json(f, self.to_dict())
805789
protected function __save()
    {
        foreach($this->records as $record)
        {
            $content = $this->getLogString($record);
            if($this->length > 0)
            {
                $content = mb_substr($content, 0, $this->length) . '...';
            }
            echo $content, PHP_EOL;
        }
    }
1123400
public function save()
    {
        $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
        $aRDFaDeliveries = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("ardfadeliveries");

        // Delete old mappings
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sOxIdParameter = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid");
        $sSql = "DELETE FROM oxobject2delivery WHERE oxdeliveryid = '{$sOxIdParameter}' AND OXTYPE = 'rdfadeliveryset'";
        $oDb->execute($sSql);

        // Save new mappings
        foreach ($aRDFaDeliveries as $sDelivery) {
            $oMapping = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
            $oMapping->init("oxobject2delivery");
            $oMapping->assign($aParams);
            $oMapping->oxobject2delivery__oxobjectid = new \OxidEsales\Eshop\Core\Field($sDelivery);
            $oMapping->save();
        }
    }
783782
def save(self):
        
        with open(self.filename, 'w') as f:
            ujson.dump(self.config, f, indent=4)
822404
def save_all(self):
        
        for index in range(self.get_stack_count()):
            if self.data[index].editor.document().isModified():
                self.save(index)
1164695
public function settings(){
        if (is_file($this->path.'/.markdb')){

            $attributes = \Symfony\Component\Yaml\Yaml::parse(file_get_contents($this->path.'/.markdb'));
            $this->attributes = $attributes;

            foreach($attributes as $key=>$value){
                if (empty($this->{$key})) {
                    $this->{$key} = $value;
                }
            }
        }

        if (!isset($this->slug)){
            $this->slug = $this->name;
        }

        $this->base = empty($this->base) ? ($this->parent() ? $this->parent()->base : false) : $this->base;
        $this->slug = new Slug(MarkDb::sluggify(implode('/',array_filter([($this->parent ? $this->parent->slug : null),$this->slug]))), $this->base);

        if (!empty($this->date)){
            $this->date = \Carbon\Carbon::createFromTimestamp(strtotime($this->date));
        }

    }
830807
private function store()
    {
        $settings = [];
        foreach ($this->settings as $key => $value) {
            $settings[$key] = serialize($value);
        }
        file_put_contents($this->cacheFile, json_encode($settings));
    }
701996
def _save_settings(self):
        
        if self._autosettings_path == None: return
        
        # Get the gui settings directory
        gui_settings_dir = _os.path.join(_cwd, 'egg_settings')

        # make sure the directory exists
        if not _os.path.exists(gui_settings_dir): _os.mkdir(gui_settings_dir)

        # make a path with a sub-directory
        path = _os.path.join(gui_settings_dir, self._autosettings_path)
        
        # Create a Qt settings object
        settings = _g.QtCore.QSettings(path, _g.QtCore.QSettings.IniFormat)
        settings.clear()
        
        # Save values
        if hasattr_safe(self._window, "saveState"):
            settings.setValue('State',self._window.saveState())
        settings.setValue('Geometry', self._window.saveGeometry())
704420
protected function saveSettings()
    {
        $result = Eresus_CMS::getLegacyKernel()->db
            ->selectItem('plugins', "`name`='{$this->getName()}'");
        $result = $this->__item($result);
        $result['settings'] = Eresus_CMS::getLegacyKernel()->db
            ->escape(encodeOptions($this->settings));
        $result = Eresus_CMS::getLegacyKernel()->db->
            updateItem('plugins', $result, "`name`='".$this->getName()."'");

        return $result;
    }
1230645
public function updateSettings()
    {
        foreach ($this->settings as $key => &$value)
        {
            if (!is_null(arg($key)))
            {
                $value = arg($key);
            }
        }
        $this->onSettingsUpdate();
        $this->saveSettings();
    }
449220
def saveSettings(self, settings):
        
        lvls = []
        for logger, level in self.loggerLevels().items():
            lvls.append('{0}:{1}'.format(logger, level))
        
        settings.setValue('format', wrapVariant(self.formatText()))
        settings.setValue('levels', ','.join(map(str, self.activeLevels())))
        settings.setValue('loggerLevels', ','.join(lvls))