python类localhost()的实例源码

urllib2.py 文件源码 项目:pmatic 作者: LarsMichelsen 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def get_names(self):
        if FileHandler.names is None:
            try:
                FileHandler.names = tuple(
                    socket.gethostbyname_ex('localhost')[2] +
                    socket.gethostbyname_ex(socket.gethostname())[2])
            except socket.gaierror:
                FileHandler.names = (socket.gethostbyname('localhost'),)
        return FileHandler.names

    # not entirely sure what the rules are here
urllib2.py 文件源码 项目:snorkel-biocorpus 作者: HazyResearch 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def file_open(self, req):
        url = req.get_selector()
        if url[:2] == '//' and url[2:3] != '/' and (req.host and
                req.host != 'localhost'):
            req.type = 'ftp'
            return self.parent.open(req)
        else:
            return self.open_local_file(req)

    # names for the localhost
urllib2.py 文件源码 项目:snorkel-biocorpus 作者: HazyResearch 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def get_names(self):
        if FileHandler.names is None:
            try:
                FileHandler.names = tuple(
                    socket.gethostbyname_ex('localhost')[2] +
                    socket.gethostbyname_ex(socket.gethostname())[2])
            except socket.gaierror:
                FileHandler.names = (socket.gethostbyname('localhost'),)
        return FileHandler.names

    # not entirely sure what the rules are here
urllib2.py 文件源码 项目:Docker-XX-Net 作者: kuanghy 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def file_open(self, req):
        url = req.get_selector()
        if url[:2] == '//' and url[2:3] != '/' and (req.host and
                req.host != 'localhost'):
            req.type = 'ftp'
            return self.parent.open(req)
        else:
            return self.open_local_file(req)

    # names for the localhost
urllib2.py 文件源码 项目:Docker-XX-Net 作者: kuanghy 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def get_names(self):
        if FileHandler.names is None:
            try:
                FileHandler.names = tuple(
                    socket.gethostbyname_ex('localhost')[2] +
                    socket.gethostbyname_ex(socket.gethostname())[2])
            except socket.gaierror:
                FileHandler.names = (socket.gethostbyname('localhost'),)
        return FileHandler.names

    # not entirely sure what the rules are here
_urllib2_fork.py 文件源码 项目:addon 作者: alfa-addon 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def get_names(self):
        if FileHandler.names is None:
            try:
                FileHandler.names = (socket.gethostbyname('localhost'),
                                    socket.gethostbyname(socket.gethostname()))
            except socket.gaierror:
                FileHandler.names = (socket.gethostbyname('localhost'),)
        return FileHandler.names

    # not entirely sure what the rules are here
_urllib2_fork.py 文件源码 项目:BruteXSS 作者: rajeshmajumdar 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def get_names(self):
        if FileHandler.names is None:
            try:
                FileHandler.names = (socket.gethostbyname('localhost'),
                                    socket.gethostbyname(socket.gethostname()))
            except socket.gaierror:
                FileHandler.names = (socket.gethostbyname('localhost'),)
        return FileHandler.names

    # not entirely sure what the rules are here


问题


面经


文章

微信
公众号

扫码关注公众号