def add(self, srcs, toplevel=False, initialize=False): self._pre_root = None sources = set(self._try_restore(srcs)) self._restored_sources.update(sources) sources.update(srcs) self.sources.update(sources) if toplevel: self.toplevel_sources.update(sources) if initialize: self._initialize_sources(sources) self._cache_sources(sources) self.rescanner.set_catalog(self.sources)
def add(self, plugin_id, srcs, toplevel=False, initialize=False): self._invalidate_root() sources = set(self._try_restore(srcs)) sources.update(srcs) self.sources.update(sources) if toplevel: self.toplevel_sources.update(sources) if initialize: self._initialize_sources(sources) self._cache_sources(sources) self.rescanner.set_catalog(self.sources) if plugin_id: self._register_plugin_objects(plugin_id, *sources)