Updates the system descriptions.
492789
private function registerDistribution()
    {
        /*
         * If a system entry already exists (e.g. from sample
         * data), then update it.
         */
        $system = $this->systemService->getActiveSystem();

        if (!$system) {
            $system = new System();
        }

        $config = $this->rootDir.'composer.json';
        $configContent = file_get_contents($config);
        $this->appComposerJson = json_decode($configContent, true);

        $system->setPackage($this->appComposerJson['name']);
        $system->setName($this->appComposerJson['description']);
        $system->setVersion($this->appComposerJson['version']);
        $system->setHomepage($this->appComposerJson['homepage']);
        $system->setModules($this->appComposerJson['extra']['campaignchain']['distribution']['modules']);

        if (
            isset($this->appComposerJson['extra']['campaignchain']['distribution']['terms-url']) &&
            !empty($this->appComposerJson['extra']['campaignchain']['distribution']['terms-url'])
        ) {
            $system->setTermsUrl($this->appComposerJson['extra']['campaignchain']['distribution']['terms-url']);
        }

        $this->em->persist($system);
        $this->em->flush();
    }
212089
async def update(self):
        """"""
        status_data = await self._request('/status.json?show_avail=1')

        if status_data:
            self.status_data = status_data

            sensor_data = await self._request('/sensors.json')
            if sensor_data:
                self.sensor_data = sensor_data
208617
def update(self, *others):
        """"""
        self.db.sunionstore(self.key, [self.key] + [o.key for o in others])
1157519
def update(self):
        """"""
        for channel in self.channels:
            channel.update()
        for i in range(len(self._project_dict["channels"])):
            channel_dict = self._project_dict["channels"][i]
            for channel in self.channels:
                if channel.name == channel_dict["common.ALLTYPES_NAME"]:
                    self._project_dict["channels"][i] = channel.as_dict()
472395
def update(self):
        """"""
        node = self._fritz.get_device_element(self.ain)
        self._update_from_node(node)
12328
def _update(self):
        """"""
        self.clear()
        self._set_boutons_communs()
        if self.interface:
            self.addSeparator()
            l_actions = self.interface.get_actions_toolbar()
            self._set_boutons_interface(l_actions)
1159373
def update(cls, settings):
        """"""
        for key, val in settings.__dict__.items():
            if key.startswith('_'):
                continue
            setattr(cls, key, val)
1119323
def update(cls, id, memory, cores, console, password, background,
               max_memory):
        """"""
        if not background and not cls.intty():
            background = True

        vm_params = {}

        if memory:
            vm_params['memory'] = memory

        if cores:
            vm_params['cores'] = cores

        if console:
            vm_params['console'] = console

        if password:
            vm_params['password'] = password

        if max_memory:
            vm_params['vm_max_memory'] = max_memory

        result = cls.call('hosting.vm.update', cls.usable_id(id), vm_params)
        if background:
            return result

        # interactive mode, run a progress bar
        cls.echo('Updating your Virtual Machine %s.' % id)
        cls.display_progress(result)
1131253
def update(self):
        """"""
        # Init new stats
        stats = self.get_init_value()

        if self.input_method == 'local':
            # Update stats using the standard system lib
            # Grab SWAP using the psutil swap_memory method
            sm_stats = psutil.swap_memory()

            # Get all the swap stats (copy/paste of the psutil documentation)
            # total: total swap memory in bytes
            # used: used swap memory in bytes
            # free: free swap memory in bytes
            # percent: the percentage usage
            # sin: the number of bytes the system has swapped in from disk (cumulative)
            # sout: the number of bytes the system has swapped out from disk
            # (cumulative)
            for swap in ['total', 'used', 'free', 'percent',
                         'sin', 'sout']:
                if hasattr(sm_stats, swap):
                    stats[swap] = getattr(sm_stats, swap)
        elif self.input_method == 'snmp':
            # Update stats using SNMP
            if self.short_system_name == 'windows':
                # Mem stats for Windows OS are stored in the FS table
                try:
                    fs_stat = self.get_stats_snmp(snmp_oid=snmp_oid[self.short_system_name],
                                                  bulk=True)
                except KeyError:
                    self.reset()
                else:
                    for fs in fs_stat:
                        # The virtual memory concept is used by the operating
                        # system to extend (virtually) the physical memory and
                        # thus to run more programs by swapping unused memory
                        # zone (page) to a disk file.
                        if fs == 'Virtual Memory':
                            stats['total'] = int(
                                fs_stat[fs]['size']) * int(fs_stat[fs]['alloc_unit'])
                            stats['used'] = int(
                                fs_stat[fs]['used']) * int(fs_stat[fs]['alloc_unit'])
                            stats['percent'] = float(
                                stats['used'] * 100 / stats['total'])
                            stats['free'] = stats['total'] - stats['used']
                            break
            else:
                stats = self.get_stats_snmp(snmp_oid=snmp_oid['default'])

                if stats['total'] == '':
                    self.reset()
                    return stats

                for key in iterkeys(stats):
                    if stats[key] != '':
                        stats[key] = float(stats[key]) * 1024

                # used=total-free
                stats['used'] = stats['total'] - stats['free']

                # percent: the percentage usage calculated as (total -
                # available) / total * 100.
                stats['percent'] = float(
                    (stats['total'] - stats['free']) / stats['total'] * 100)

        # Update the stats
        self.stats = stats

        return self.stats
963642
def update(self):
        """"""
        self._attrs = self._session.refresh_attributes(self.name)
        self._attrs = assert_is_dict(self._attrs)

        # force base_state to update properties
        if self.base_station:
            self.base_station.update()
383553
def update(self):
        """"""
        # Init new stats
        stats = self.get_init_value()

        if self.input_method == 'local':
            # Update stats using the standard system lib

            # Get the load using the os standard lib
            load = self._getloadavg()
            if load is None:
                stats = self.get_init_value()
            else:
                stats = {'min1': load[0],
                         'min5': load[1],
                         'min15': load[2],
                         'cpucore': self.nb_log_core}

        elif self.input_method == 'snmp':
            # Update stats using SNMP
            stats = self.get_stats_snmp(snmp_oid=snmp_oid)

            if stats['min1'] == '':
                stats = self.get_init_value()
                return stats

            # Python 3 return a dict like:
            # {'min1': "b'0.08'", 'min5': "b'0.12'", 'min15': "b'0.15'"}
            for k, v in iteritems(stats):
                stats[k] = float(v)

            stats['cpucore'] = self.nb_log_core

        # Update the stats
        self.stats = stats

        return self.stats
71642
def __update_info(self):
        """"""

        from f311 import explorer as ex
        import f311

        t = self.tableWidget
        z = self.listWidgetVis
        z.clear()
        classes = self.__vis_classes = []
        propss = self.__lock_get_current_propss()
        npp = len(propss)
        s0, s1 = "", ""
        if npp == 1:
            p = propss[0]
            # Visualization options
            if p.flag_scanned:
                if isinstance(p.f, f311.DataFile):
                    classes.extend(f311.get_suitable_vis_classes(p.f))
                    if ex.VisPrint in classes:
                        classes.remove(ex.VisPrint)
                if p.flag_text:
                    # This is an exception, since "txt" is not a Vis descendant.
                    # This will be properly handled in __visualize()
                    classes.append("txt")

                for x in classes:
                    if x == "txt":
                        text = "View plain text"
                    else:
                        text = x.action
                        text += " ("+x.__name__+")"
                    item = QListWidgetItem(text)
                    z.addItem(item)

            # File info
            s0 = p.get_summary()
            s1 = p.get_info()

        elif npp >= 2:
            s0 = "{0:d} selected".format(npp)
            ff = [p.f for p in propss]
            flag_spectra = all([isinstance(f, f311.FileSpectrum) for f in ff])

            # gambiarra to visualize several PFANT .mod files
            has_pyfant = False
            try:
                import pyfant
                has_pyfant = True
            except:
                pass

            flag_mod = False
            if has_pyfant:
                flag_mod = all([isinstance(f, pyfant.FileModBin) and len(f.records) > 1 for f in ff])

            if flag_spectra:
                z.addItem(QListWidgetItem("Plot spectra stacked"))
                classes.append("sta")
                z.addItem(QListWidgetItem("Plot spectra overlapped"))
                classes.append("ovl")
            elif flag_mod:

                # TODO plugin-based way to handle visualization of multiple selection

                z.addItem(QListWidgetItem("View model grid"))
                classes.append("modgrid")
                
        # File info
        self.labelSummary.setText(s0)
        self.textEditInfo.setPlainText(s1)
204743
protected void processDescriptions(List<MonolingualTextValue> descriptions) {
        for(MonolingualTextValue description : descriptions) {
        	NameWithUpdate currentValue = newDescriptions.get(description.getLanguageCode());
        	// only mark the description as added if the value we are writing is different from the current one
        	if (currentValue == null || !currentValue.value.equals(description)) {
        		newDescriptions.put(description.getLanguageCode(),
                    new NameWithUpdate(description, true));
        	}
        }
    }
438148
def _add_details(self, info):
        """"""
        for (key, val) in six.iteritems(info):
            if key == "nodes":
                val = [Node(parent=self, **nd) for nd in val]
            elif key == "sessionPersistence":
                val = val['persistenceType']
            elif key == "cluster":
                val = val['name']
            elif key == "virtualIps":
                key = "virtual_ips"
                val = [VirtualIP(parent=self, **vip) for vip in val]
            setattr(self, key, val)
747676
def update(self):
        
        # Init new stats
        stats = self.get_init_value()

        if self.input_method == 'local':
            # Update stats using the standard system lib
            stats['os_name'] = platform.system()
            stats['hostname'] = platform.node()
            stats['platform'] = platform.architecture()[0]
            if stats['os_name'] == "Linux":
                try:
                    linux_distro = platform.linux_distribution()
                except AttributeError:
                    stats['linux_distro'] = _linux_os_release()
                else:
                    if linux_distro[0] == '':
                        stats['linux_distro'] = _linux_os_release()
                    else:
                        stats['linux_distro'] = ' '.join(linux_distro[:2])
                stats['os_version'] = platform.release()
            elif (stats['os_name'].endswith('BSD') or
                  stats['os_name'] == 'SunOS'):
                stats['os_version'] = platform.release()
            elif stats['os_name'] == "Darwin":
                stats['os_version'] = platform.mac_ver()[0]
            elif stats['os_name'] == "Windows":
                os_version = platform.win32_ver()
                stats['os_version'] = ' '.join(os_version[::2])
                # if the python version is 32 bit perhaps the windows operating
                # system is 64bit
                if stats['platform'] == '32bit' and 'PROCESSOR_ARCHITEW6432' in os.environ:
                    stats['platform'] = '64bit'
            else:
                stats['os_version'] = ""
            # Add human readable name
            if stats['os_name'] == "Linux":
                stats['hr_name'] = stats['linux_distro']
            else:
                stats['hr_name'] = '{} {}'.format(
                    stats['os_name'], stats['os_version'])
            stats['hr_name'] += ' {}'.format(stats['platform'])

        elif self.input_method == 'snmp':
            # Update stats using SNMP
            try:
                stats = self.get_stats_snmp(
                    snmp_oid=snmp_oid[self.short_system_name])
            except KeyError:
                stats = self.get_stats_snmp(snmp_oid=snmp_oid['default'])
            # Default behavor: display all the information
            stats['os_name'] = stats['system_name']
            # Windows OS tips
            if self.short_system_name == 'windows':
                for r, v in iteritems(snmp_to_human['windows']):
                    if re.search(r, stats['system_name']):
                        stats['os_name'] = v
                        break
            # Add human readable name
            stats['hr_name'] = stats['os_name']

        # Update the stats
        self.stats = stats

        return self.stats
556862
def update(self):
        """"""
        self._controller.update(self._id, wake_if_asleep=False)
        data = self._controller.get_drive_params(self._id)
        if data:
            if not data['shift_state'] or data['shift_state'] == 'P':
                self.__state = True
            else:
                self.__state = False
1079516
def update(self, content=None):
        
        if not content:
            return
        if content == 'summary' or 'extended' or 'powerflow':
            self._update_summary(self.system)
        if content == 'extended' or 'powerflow':
            self._update_extended(self.system)