def __str__(self):
illegals = []
for u in self.uris:
assert isinstance(u, six.string_types)
scheme = urlsplit(u,
allow_fragments=0)[0]
illegals.append((u, scheme))
if len(illegals) > 1:
msg = _("The follwing URIs use unsupported "
"schemes. Supported schemes are "
"file://, http://, and https://.")
for i, s in illegals:
msg += _("\n {uri} (scheme: "
"{scheme})").format(uri=i, scheme=s)
return msg
elif len(illegals) == 1:
i, s = illegals[0]
return _("The URI '{uri}' uses the unsupported "
"scheme '{scheme}'. Supported schemes are "
"file://, http://, and https://.").format(
uri=i, scheme=s)
return _("The specified URI uses an unsupported scheme."
" Supported schemes are: file://, http://, and "
"https://.")
评论列表
文章目录