Ejemplo n.º 1
0
	def import_feed(self, url, contents):
		"""contents can be a path or an Element."""
		iface_cache = self.config.iface_cache
		iface_cache.get_interface(url)

		if isinstance(contents, qdom.Element):
			feed = model.ZeroInstallFeed(contents)
		else:
			feed = reader.load_feed(contents)

		iface_cache._feeds[url] = feed
		return feed
Ejemplo n.º 2
0
    def import_feed(self, url, contents):
        """contents can be a path or an Element."""
        iface_cache = self.config.iface_cache
        iface_cache.get_interface(url)

        if isinstance(contents, qdom.Element):
            feed = model.ZeroInstallFeed(contents)
        else:
            feed = reader.load_feed(contents)

        iface_cache._feeds[url] = feed
        return feed
Ejemplo n.º 3
0
    def import_feed(self, url, contents):
        """contents can be a path or an Element."""
        iface_cache = self.config.iface_cache
        iface_cache.get_interface(url)

        if isinstance(contents, qdom.Element):
            feed = model.ZeroInstallFeed(contents)
        else:
            feed = reader.load_feed(contents)

        iface_cache._feeds[url] = feed

        xml = qdom.to_UTF8(feed.feed_element)
        upstream_dir = basedir.save_cache_path(namespaces.config_site, "interfaces")
        cached = os.path.join(upstream_dir, model.escape(url))
        with open(cached, "wb") as stream:
            stream.write(xml)

        return feed
Ejemplo n.º 4
0
	def get_uncached_implementations(self):
		"""List all chosen implementations which aren't yet available locally.
		@rtype: [(L{model.Interface}, L{model.Implementation})]"""
		iface_cache = self.config.iface_cache
		uncached = []
		for uri, selection in self.solver.selections.selections.iteritems():
			impl = selection.impl
			assert impl, self.solver.selections
			if not self.get_cached(impl):
				uncached.append((iface_cache.get_interface(uri), impl))
		return uncached
Ejemplo n.º 5
0
	def import_feed(self, url, path):
		iface_cache = self.config.iface_cache
		iface_cache.get_interface(url)
		feed = iface_cache._feeds[url] = reader.load_feed(path)
		return feed
Ejemplo n.º 6
0
	def import_feed(self, url, path):
		iface_cache = self.config.iface_cache
		iface_cache.get_interface(url)
		feed = iface_cache._feeds[url] = reader.load_feed(path)
		return feed