示例#1
0
 def _get_mirror_url(self, feed_url, resource):
     """Return the URL of a mirror for this feed."""
     if self.config.mirror is None:
         return None
     if support.urlparse(feed_url).hostname == "localhost":
         return None
     return "%s/%s/%s" % (self.config.mirror, _get_feed_dir(feed_url), resource)
示例#2
0
	def _get_mirror_url(self, feed_url, resource):
		"""Return the URL of a mirror for this feed."""
		if self.config.mirror is None:
			return None
		if support.urlparse(feed_url).hostname == 'localhost':
			return None
		return '%s/%s/%s' % (self.config.mirror, _get_feed_dir(feed_url), resource)
示例#3
0
	def _get_mirror_url(self, feed_url, resource):
		"""Return the URL of a mirror for this feed.
		@type feed_url: str
		@type resource: str
		@rtype: str"""
		if self.config.mirror is None:
			return None
		if feed_url.startswith('http://') or feed_url.startswith('https://'):
			if support.urlparse(feed_url).hostname == 'localhost':
				return None
			return '%s/%s/%s' % (self.config.mirror, _get_feed_dir(feed_url), resource)
		return None
示例#4
0
 def _get_archive_mirror(self, source):
     if self.config.mirror is None:
         return None
     if support.urlparse(source.url).hostname == "localhost":
         return None
     if sys.version_info[0] > 2:
         from urllib.parse import quote
     else:
         from urllib import quote
     return "{mirror}/archive/{archive}".format(
         mirror=self.config.mirror, archive=quote(source.url.replace("/", "#"), safe="")
     )
示例#5
0
 def _get_archive_mirror(self, source):
     if self.config.mirror is None:
         return None
     if support.urlparse(source.url).hostname == 'localhost':
         return None
     if sys.version_info[0] > 2:
         from urllib.parse import quote
     else:
         from urllib import quote
     return '{mirror}/archive/{archive}'.format(
         mirror=self.config.mirror,
         archive=quote(source.url.replace('/', '#'), safe=''))
示例#6
0
	def _get_archive_mirror(self, source):
		if self.config.mirror is None:
			return None
		if support.urlparse(source.url).hostname == 'localhost':
			return None
		if sys.version_info[0] > 2:
			from urllib.parse import quote
		else:
			from urllib import quote
		return '{mirror}/archive/{archive}'.format(
				mirror = self.config.mirror,
				archive = quote(source.url.replace('/', '#'), safe = ''))
示例#7
0
	def _get_mirror_url(self, feed_url, resource):
		"""Return the URL of a mirror for this feed.
		@type feed_url: str
		@type resource: str
		@rtype: str"""
		if self.config.mirror is None:
			return None
		if feed_url.startswith('http://') or feed_url.startswith('https://'):
			if support.urlparse(feed_url).hostname == 'localhost':
				return None
			return '%s/%s/%s' % (self.config.mirror, _get_feed_dir(feed_url), resource)
		return None