Beispiel #1
0
	def distro(self):
		if self._distro is None:
			from zeroinstall.injector.distro import get_host_distribution
			self._distro = get_host_distribution()
		return self._distro
Beispiel #2
0
def get_distro():
	global _distro
	if _distro is None:
		_distro = get_host_distribution()
	return _distro
    try:
        root = qdom.parse(file(source))
    except IOError, ex:
        if ex.errno == 2:
            raise InvalidInterface(
                _("Feed not found. Perhaps this is a local feed that no longer exists? You can remove it from the list of feeds in that case."
                  ), ex)
        raise InvalidInterface(_("Can't read file"), ex)
    except Exception, ex:
        raise InvalidInterface(_("Invalid XML"), ex)

    if local:
        local_path = source
    else:
        local_path = None
    feed = ZeroInstallFeed(root, local_path, distro.get_host_distribution())
    feed.last_modified = int(os.stat(source).st_mtime)

    if not local:
        if feed.url != interface.uri:
            raise InvalidInterface(
                _("Incorrect URL used for feed.\n\n"
                  "%(feed_url)s is given in the feed, but\n"
                  "%(interface_uri)s was requested") % {
                      'feed_url': feed.url,
                      'interface_uri': interface.uri
                  })

    interface._main_feed = feed
    return feed
Beispiel #4
0
 def distro(self):
     if self._distro is None:
         from zeroinstall.injector.distro import get_host_distribution
         self._distro = get_host_distribution()
     return self._distro