Save the selected cmap.
505835
def _button_delete_clicked(self):
        
        name = str(self._combobox_cmaps.currentText())
        self.delete_colormap(name)
        self._combobox_cmaps.setEditText("")
        self._load_cmap_list()
360474
def save(self):
        """"""
        for server, conf in self.servers.iteritems():
            self._add_index_server()
            for conf_k, conf_v in conf.iteritems():
                if not self.conf.has_section(server):
                    self.conf.add_section(server)
                self.conf.set(server, conf_k, conf_v)

        with open(self.rc_file, 'wb') as configfile:
            self.conf.write(configfile)
        self.conf.read(self.rc_file)
748262
public void saveToSetupBean() {

        Map<String, String[]> result = new HashMap<String, String[]>();

        CmsSetupBean bean = m_setupBean;
        if (m_dbCreateUser.isVisible()) {
            bean.setDbCreateUser(m_dbCreateUser.getValue());
        }
        if (m_dbCreatePwd.isVisible()) {
            bean.setDbCreatePwd(m_dbCreatePwd.getValue());
        }
        if (m_dbWorkUser.isVisible()) {
            bean.setDbWorkUser(m_dbWorkUser.getValue());
        }

        if (m_templateDb.isVisible()) {
            setDbProp("templateDb", m_templateDb.getValue());
        }

        if (m_dbWorkPwd.isVisible()) {
            bean.setDbWorkPwd(m_dbWorkPwd.getValue());
        }

        if (m_dbCreateConStr.isVisible()) {
            bean.setDbCreateConStr(m_dbCreateConStr.getValue());
        }

        if (m_dbName.isVisible()) {
            bean.setDb(m_dbName.getValue());
        }

        result.put("dbCreateConStr", new String[] {m_dbCreateConStr.getValue()});

        result.put("dbName", new String[] {bean.getDatabase()});
        result.put("dbProduct", new String[] {bean.getDatabase()});
        result.put("dbProvider", new String[] {"sql"});
        result.put("dbName", new String[] {m_dbName.getValue()});
        result.put("db", new String[] {bean.getDb()});
        result.put("createDb", new String[] {Boolean.toString(m_createDb.getValue().booleanValue())});
        result.put("createTables", new String[] {Boolean.toString(m_createTables.getValue().booleanValue())});
        result.put("jdbcDriver", new String[] {dbProp("driver")});
        result.put("templateDb", new String[] {dbProp("templateDb")});
        result.put("dbCreateUser", new String[] {bean.getDbCreateUser()});
        result.put("dbCreatePwd", new String[] {bean.getDbCreatePwd()});
        result.put("dbWorkUser", new String[] {bean.getDbWorkUser()});
        result.put("dbWorkPwd", new String[] {bean.getDbWorkPwd()});
        result.put("dbDefaultTablespace", new String[] {m_defaultTablespace.getValue()});
        result.put("dbTemporaryTablespace", new String[] {m_temporaryTablespace.getValue()});
        result.put("dbIndexTablespace", new String[] {m_indexTablespace.getValue()});
        // result.put("servletMapping", new String[] {getServeltMapping()});
        result.put("submit", new String[] {Boolean.TRUE.toString()});
        bean.setDbParamaters(result, bean.getDatabase(), null, null);

    }
1085867
def save_toc(self, tocpos):
        """"""
        self.tocpos = tocpos
        tocstr = self.toc.tobinary()
        self.toclen = len(tocstr)
        self.lib.write(tocstr)
435051
def save(self):
        """"""
        if self.SacrificeDate:
            self.Active = False
        super(PlugEvents, self).save()
1098172
private void saveProperties(String resourcePath, Map<String, String> properties) throws CmsException {

        CmsResource resource;
        CmsObject cms = getCmsObject();
        int pos = resourcePath.indexOf("?");
        String resName = resourcePath;
        if (pos > -1) {
            resName = resourcePath.substring(0, pos);
        }
        resource = cms.readResource(resName);

        if (properties != null) {
            for (Entry<String, String> entry : properties.entrySet()) {
                String propertyName = entry.getKey();
                String propertyValue = entry.getValue();
                if (CmsStringUtil.isEmptyOrWhitespaceOnly(propertyValue)) {
                    propertyValue = "";
                }
                try {
                    CmsProperty currentProperty = cms.readPropertyObject(resource, propertyName, false);
                    // detect if property is a null property or not
                    if (currentProperty.isNullProperty()) {
                        // create new property object and set key and value
                        currentProperty = new CmsProperty();
                        currentProperty.setName(propertyName);
                        if (OpenCms.getWorkplaceManager().isDefaultPropertiesOnStructure()) {
                            // set structure value
                            currentProperty.setStructureValue(propertyValue);
                            currentProperty.setResourceValue(null);
                        } else {
                            // set resource value
                            currentProperty.setStructureValue(null);
                            currentProperty.setResourceValue(propertyValue);
                        }
                    } else if (currentProperty.getStructureValue() != null) {
                        // structure value has to be updated
                        currentProperty.setStructureValue(propertyValue);
                        currentProperty.setResourceValue(null);
                    } else {
                        // resource value has to be updated
                        currentProperty.setStructureValue(null);
                        currentProperty.setResourceValue(propertyValue);
                    }
                    CmsLock lock = cms.getLock(resource);
                    if (lock.isUnlocked()) {
                        // lock resource before operation
                        cms.lockResource(resName);
                    }
                    // write the property to the resource
                    cms.writePropertyObject(resName, currentProperty);
                    // unlock the resource
                    cms.unlockResource(resName);
                } catch (CmsException e) {
                    // writing the property failed, log error
                    log(e.getLocalizedMessage());
                }
            }
        }
    }
18828
def save(self):
        
        storage = get_media_storage()
        for storage_name in self.cleaned_data['selected_files']:
            full_path = storage.path(storage_name)
            try:
                storage.delete(storage_name)
                self.success_files.append(full_path)
            except OSError:
                self.error_files.append(full_path)
923292
def process_cmap(cmap, ncolors=None, provider=None, categorical=False):
    
    providers_checked="matplotlib, bokeh, or colorcet" if provider is None else provider

    if isinstance(cmap, Cycle):
        palette = [rgb2hex(c) if isinstance(c, tuple) else c for c in cmap.values]
    elif isinstance(cmap, list):
        palette = cmap
    elif isinstance(cmap, basestring):
        mpl_cmaps = _list_cmaps('matplotlib')
        bk_cmaps = _list_cmaps('bokeh')
        cet_cmaps = _list_cmaps('colorcet')
        if provider=='matplotlib' or (provider is None and (cmap in mpl_cmaps or cmap.lower() in mpl_cmaps)):
            palette = mplcmap_to_palette(cmap, ncolors, categorical)
        elif provider=='bokeh' or (provider is None and (cmap in bk_cmaps or cmap.capitalize() in bk_cmaps)):
            palette = bokeh_palette_to_palette(cmap, ncolors, categorical)
        elif provider=='colorcet' or (provider is None and cmap in cet_cmaps):
            from colorcet import palette
            if cmap.endswith('_r'):
                palette = list(reversed(palette[cmap[:-2]]))
            else:
                palette = palette[cmap]
        else:
            raise ValueError("Supplied cmap %s not found among %s colormaps." %
                             (cmap,providers_checked))
    else:
        try:
            # Try processing as matplotlib colormap
            palette = mplcmap_to_palette(cmap, ncolors)
        except:
            palette = None
    if not isinstance(palette, list):
        raise TypeError("cmap argument %s expects a list, Cycle or valid %s colormap or palette."
                        % (cmap,providers_checked))
    if ncolors and len(palette) != ncolors:
        return [palette[i%len(palette)] for i in range(ncolors)]
    return palette
527859
void save() {

        try {
            byte[] content = m_codeMirror.getValue().getBytes(m_file.getEncoding());
            m_file.getFile().setContents(content);
            A_CmsUI.getCmsObject().writeFile(m_file.getFile());
            m_changed = false;
            m_save.setEnabled(false);
            m_saveAndExit.setEnabled(false);
        } catch (Exception e) {
            CmsErrorDialog.showErrorDialog(e);
        }
    }
878654
def _save(self, data):
        
        self.name = data.get('name')
        self.type = data.get('type')
        self.state = data.get('state')
        self.dataset = data.get('dataset')
        self.memory = data.get('memory')
        self.disk = data.get('disk')
        self._ips = data.get('ips', [])
        self.metadata = data.get('metadata', {})
        if not hasattr(self, '_credentials'):
            self._credentials = {}
        self._credentials.update(self.metadata.pop('credentials', {}))
        self.boot_script = self.metadata.pop('user-script', None)
        self.created = dt_time(data.get('created'))
        self.updated = dt_time(data.get('updated', data.get('created')))
290830
def save_cursor(self):
        """"""
        self.savepoints.append(Savepoint(copy.copy(self.cursor),
                                         self.g0_charset,
                                         self.g1_charset,
                                         self.charset,
                                         mo.DECOM in self.mode,
                                         mo.DECAWM in self.mode))
133054
public void saveProperties(Command afterSaveCommand) {

        Map<String, String> properties = new HashMap<String, String>();
        for (Widget property : m_propertiesPanel) {
            CmsPropertyForm form = ((CmsPropertyForm)property);
            if (form.isChanged()) {
                properties.put(form.getId(), form.getValue());
            }
        }
        m_handler.saveProperties(properties, afterSaveCommand);
    }
826853
void saveOU() {

        try {
            List<String> resources = new ArrayList<String>();
            for (I_CmsEditableGroupRow row : m_ouResources.getRows()) {
                resources.add(((CmsPathSelectField)row.getComponent()).getValue());
            }
            if (m_ou == null) {
                String parentOu = m_parentOu.getValue();
                if (!parentOu.endsWith("/")) {
                    parentOu += "/";
                }
                if (resources.contains("null")) {
                    resources.remove("null");
                }
                List<String> resourceNames = CmsFileUtil.removeRedundancies(resources);
                m_ou = OpenCms.getOrgUnitManager().createOrganizationalUnit(
                    m_cms,
                    parentOu + m_name.getValue(),
                    m_description.getValue(),
                    getFlags(),
                    resourceNames.isEmpty() ? null : resourceNames.get(0));

                if (!resourceNames.isEmpty()) {
                    resourceNames.remove(0);
                    Iterator<String> itResourceNames = CmsFileUtil.removeRedundancies(resourceNames).iterator();
                    while (itResourceNames.hasNext()) {
                        OpenCms.getOrgUnitManager().addResourceToOrgUnit(m_cms, m_ou.getName(), itResourceNames.next());
                    }
                }
            } else {
                m_ou.setDescription(m_description.getValue());
                m_ou.setFlags(getFlags());
                List<String> resourceNamesNew = CmsFileUtil.removeRedundancies(resources);
                List<CmsResource> resourcesOld = OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(
                    m_cms,
                    m_ou.getName());
                List<String> resourceNamesOld = new ArrayList<String>();
                Iterator<CmsResource> itResourcesOld = resourcesOld.iterator();
                while (itResourcesOld.hasNext()) {
                    CmsResource resourceOld = itResourcesOld.next();
                    resourceNamesOld.add(m_cms.getSitePath(resourceOld));
                }
                Iterator<String> itResourceNamesNew = resourceNamesNew.iterator();
                // add new resources to ou
                while (itResourceNamesNew.hasNext()) {
                    String resourceNameNew = itResourceNamesNew.next();
                    if (!resourceNamesOld.contains(resourceNameNew)) {
                        OpenCms.getOrgUnitManager().addResourceToOrgUnit(m_cms, m_ou.getName(), resourceNameNew);
                    }
                }
                Iterator<String> itResourceNamesOld = resourceNamesOld.iterator();
                // delete old resources from ou
                while (itResourceNamesOld.hasNext()) {
                    String resourceNameOld = itResourceNamesOld.next();
                    if (!resourceNamesNew.contains(resourceNameOld)) {
                        OpenCms.getOrgUnitManager().removeResourceFromOrgUnit(m_cms, m_ou.getName(), resourceNameOld);
                    }
                }
                // write the edited organizational unit
                OpenCms.getOrgUnitManager().writeOrganizationalUnit(m_cms, m_ou);
            }
        } catch (CmsException e) {
            LOG.error("Unable to save OU", e);
        }
    }
887628
def save(self):
        '''
        
        '''
        response = pu.open(title='Save perspective warp', patterns=['*.h5'])
        if response is not None:
            self.warp_actor.save(response)
362514
protected function saveStatsArray() {
        if (is_array($this->stats)) {
            $this->instance->saveStatus($this->cacheKeyPrefix, $this->cacheKeySuffix, serialize($this->stats), true);
        }
    }
1002178
def save_data(self, idx):
        """"""
        for subseqs in self:
            if isinstance(subseqs, abctools.OutputSequencesABC):
                subseqs.save_data(idx)
544924
def save(self, key, kw):
        
        if key not in self:
            obj = hdf5.LiteralAttrs()
        else:
            obj = self[key]
        vars(obj).update(kw)
        self[key] = obj
        self.flush()