Update components.
487
def command_update(prog_name, prof_mgr, prof_name, prog_args):

	
	
	# Retrieve arguments
	parser = argparse.ArgumentParser(
		prog=prog_name
	)
	parser.add_argument(
		"components",
		metavar="comps",
		nargs=argparse.REMAINDER,
		help="system components"
	)
	args = parser.parse_args(prog_args)
	
	# Profile load
	prof_stub = prof_mgr.load(prof_name)
	
	# Collect component stubs
	comp_stubs = []
	if len(args.components) == 0:
		raise Exception("Empty component list")
	for comp_name in args.components:
		comp_stub = prof_stub.component(comp_name)
		component_exists(prof_stub, comp_stub)
		comp_stubs.append(comp_stub)
		
	context = prof_stub.context()
	
	# Create delete plan
	plan = []
	for comp_stub in comp_stubs:
		comp_stub.delete(context, plan)
		
	# Execute delete plan
	for op in plan:
		operation_execute(op, context)
		
	# Update component stub list
	for op in plan:
		comp_stub = prof_stub.component(op.name())
		if comp_stub not in comp_stubs:
			comp_stubs.append(comp_stub)
	
	# Create insert plan
	plan = []
	for comp_stub in comp_stubs:
		comp_stub.insert(context, plan)
		
	# Execute insert plan
	for op in plan:
		operation_execute(op, context)
443644
def update_schema(self):
        """"""

        self.commit()
        self.build_source_files.schema.objects_to_record()
        self.commit()
312897
def component(self, *components):
        
        """
        for component in components:
            self._component.append(component)
        return self
561707
function componentUpdate(tag, data, expressions) {
      var __ = tag.__;
      var nextOpts = {};
      var canTrigger = tag.isMounted && !__.skipAnonymous;

      // inherit properties from the parent tag
      if (__.isAnonymous && __.parent) { extend(tag, __.parent); }
      extend(tag, data);

      updateOpts.apply(tag, [__.isLoop, __.parent, __.isAnonymous, nextOpts, __.instAttrs]);

      if (
        canTrigger &&
        tag.isMounted &&
        isFunction$1(tag.shouldUpdate) && !tag.shouldUpdate(data, nextOpts)
      ) {
        return tag
      }

      extend(tag.opts, nextOpts);

      if (canTrigger) { tag.trigger('update', data); }
      update.call(tag, expressions);
      if (canTrigger) { tag.trigger('updated'); }

      return tag
    }
329743
public final void addComponent(ComponentUpdater component)
    {
        updaters.add(component);
        services.add(component);
        if (component instanceof HandlerListener)
        {
            addListener((HandlerListener) component);
        }
    }
9900
def update(self):
        """"""
        self.json = c.get_document(self.uri.did).json()
        self.e_list = c.element_list(self.uri.as_dict()).json()
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)
33855
def update(self):
        """"""
        if not os.path.isdir(os.path.join(self.path)):
            os.makedirs(self.path)
        if not os.path.isdir(os.path.join(self.path, 'refs')):
            subprocess.check_output([
                'git', 'clone', '--bare', self.repo_git, self.path
            ])
        self.run(['gc', '--auto', '--prune=all'])
        self.run(['fetch', '-p', 'origin', '+refs/heads/*:refs/heads/*'])
        # github support
        self.run(['fetch', 'origin', '+refs/pull/*/head:refs/pull/*'])
        # gitlab support
        self.run([
            'fetch', 'origin', '+refs/merge-requests/*/head:refs/pull/*'])
484377
async function updateComponentMap() {
  const response = await fetch(GITHUB_AMPHTML_TREE_URL);
  const data = await response.json();
  const pairs = data.tree.map((item) => item.path.match(REGEX_EXTENSION_DIR))
                  .filter((match) => match && !match[1].endsWith('impl'))
                  .map((match) => [match[1], match[2]]);
  const versionMap = {};
  pairs.forEach((pair) => {
    if (!versionMap[pair[0]] || versionMap[pair[0]] < pair[1]) {
      versionMap[pair[0]] = pair[1];
    }
  });
  writeComponentsMap(COMPONENTS_MAP_PATH, versionMap);
}
1114298
def update_components(self, forcereload=False, forcerebuild=False,
                          forcecopy=True, install=False):
        """"""

        # TODO: See if we can pull out major parts of the component handling.
        # They are also used in the manage tool to instantiate the
        # component frontend bits.

        self.log("Updating components")
        components = {}

        if True:  # try:

            from pkg_resources import iter_entry_points

            entry_point_tuple = (
                iter_entry_points(group='hfos.base', name=None),
                iter_entry_points(group='hfos.sails', name=None),
                iter_entry_points(group='hfos.components', name=None)
            )

            for iterator in entry_point_tuple:
                for entry_point in iterator:
                    try:
                        name = entry_point.name
                        location = entry_point.dist.location
                        loaded = entry_point.load()

                        self.log("Entry point: ", entry_point,
                                 name,
                                 entry_point.resolve(), lvl=verbose)

                        self.log("Loaded: ", loaded, lvl=verbose)
                        comp = {
                            'package': entry_point.dist.project_name,
                            'location': location,
                            'version': str(entry_point.dist.parsed_version),
                            'description': loaded.__doc__
                        }

                        components[name] = comp
                        self.loadable_components[name] = loaded

                        self.log("Loaded component:", comp, lvl=verbose)

                    except Exception as e:
                        self.log("Could not inspect entrypoint: ", e,
                                 type(e), entry_point, iterator, lvl=error,
                                 exc=True)

                        # for name in components.keys():
                        #     try:
                        #         self.log(self.loadable_components[name])
                        #         configobject = {
                        #             'type': 'object',
                        #             'properties':
                        # self.loadable_components[name].configprops
                        #         }
                        #         ComponentBaseConfigSchema['schema'][
                        # 'properties'][
                        #             'settings'][
                        #             'oneOf'].append(configobject)
                        #     except (KeyError, AttributeError) as e:
                        #         self.log('Problematic configuration
                        # properties in '
                        #                  'component ', name, exc=True)
                        #
                        # schemastore['component'] = ComponentBaseConfigSchema

        # except Exception as e:
        #    self.log("Error: ", e, type(e), lvl=error, exc=True)
        #    return

        self.log("Checking component frontend bits in ", self.frontendroot,
                 lvl=verbose)

        # pprint(self.config._fields)
        diff = set(components) ^ set(self.config.components)
        if diff or forcecopy and self.config.frontendenabled:
            self.log("Old component configuration differs:", diff, lvl=debug)
            self.log(self.config.components, components, lvl=verbose)
            self.config.components = components
        else:
            self.log("No component configuration change. Proceeding.")

        if forcereload:
            self.log("Restarting all components.", lvl=warn)
            self._instantiate_components(clear=True)
505063
def update(ctx, no_restart, no_rebuild):
    """"""

    # 0. (NOT YET! MAKE A BACKUP OF EVERYTHING)
    # 1. update repository
    # 2. update frontend repository
    # 3. (Not yet: update venv)
    # 4. rebuild frontend
    # 5. restart service

    instance = ctx.obj['instance']

    log('Pulling github updates')
    run_process('.', ['git', 'pull', 'origin', 'master'])
    run_process('./frontend', ['git', 'pull', 'origin', 'master'])

    if not no_rebuild:
        log('Rebuilding frontend')
        install_frontend(instance, forcerebuild=True, install=False, development=True)

    if not no_restart:
        log('Restaring service')
        if instance != 'hfos':
            instance = 'hfos-' + instance

        run_process('.', ['sudo', 'systemctl', 'restart', instance])

    log('Done')
1104318
def setComponent(self, component):
        """"""
        details = component.auto_details()
        state = component.stateDict()
        for field, detail in details.items():
            val = state[field]
            self.inputWidgets[field].setValue(val)
        self._component = component
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()
1159373
def update(cls, settings):
        """"""
        for key, val in settings.__dict__.items():
            if key.startswith('_'):
                continue
            setattr(cls, key, val)
381852
def update_property(old, new):
    """"""
    update_generic(old.fdel, new.fdel)
    update_generic(old.fget, new.fget)
    update_generic(old.fset, new.fset)
277508
def update_views(self):
        """"""
        # Call the father's method
        super(Plugin, self).update_views()

        # Add specifics informations
        # Alert only
        for key in ['cpu', 'mem', 'swap']:
            if key in self.stats:
                self.views[key]['decoration'] = self.get_alert(self.stats[key], header=key)
97922
def add_components(self, components):
        
        if components:
            for component in components:
                self._components[component["name"]] = (
                    component["factory"],
                    component.get("properties", {}),
                )