api_errors.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:solaris-ips 作者: oracle 项目源码 文件源码
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://.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号