当前位置: 首页>>代码示例>>Python>>正文


Python dns.TXT属性代码示例

本文整理汇总了Python中twisted.names.dns.TXT属性的典型用法代码示例。如果您正苦于以下问题:Python dns.TXT属性的具体用法?Python dns.TXT怎么用?Python dns.TXT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在twisted.names.dns的用法示例。


在下文中一共展示了dns.TXT属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: lookupText

# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import TXT [as 别名]
def lookupText(self, name, timeout=None):
        return self._lookup(name, dns.IN, dns.TXT, timeout) 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:4,代码来源:common.py

示例2: test_lookupText

# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import TXT [as 别名]
def test_lookupText(self):
        """
        See L{test_lookupAddress}
        """
        d = client.lookupText(self.hostname)
        d.addCallback(self.checkResult, dns.TXT)
        return d 
开发者ID:proxysh,项目名称:Safejumper-for-Desktop,代码行数:9,代码来源:test_client.py

示例3: lookupDataViaTXT

# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import TXT [as 别名]
def lookupDataViaTXT(domain, prefix=""):

    _initResolver()

    lookup = "{}.{}".format(prefix, domain,) if prefix else domain
    log.debug("DNS TXT: lookup: {l}", l=lookup)
    try:
        answers = (yield DebugResolver.lookupText(lookup))[0]
    except (DomainError, AuthoritativeDomainError), e:
        log.debug("DNS TXT: lookup failed: {exc}", exc=e)
        answers = () 
开发者ID:apple,项目名称:ccs-calendarserver,代码行数:13,代码来源:utils.py

示例4: stripComments

# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import TXT [as 别名]
def stripComments(self, lines):
        """
        Work around a bug in the base implementation that causes parsing of TXT RRs with
        a ; in the RDATA to fail because the ; is treated as the start of a comment. Here
        we simply ignore all comments.
        """
        return [
            (a.find(';') == -1 or "TXT" in a) and a or a[:a.find(';')] for a in [
                b.strip() for b in lines
            ]
        ] 
开发者ID:apple,项目名称:ccs-calendarserver,代码行数:13,代码来源:utils.py

示例5: parseLines

# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import TXT [as 别名]
def parseLines(self, lines):
        """
        Work around a bug in the base implementation that causes parsing of TXT RRs with
        spaces in the RDATA to be broken into multiple fragments and for quotes around the
        data to not be removed.
        """
        for line in lines:
            if line[3] == "TXT":
                line[4] = " ".join(line[4:])[1:-1]
                del line[5:]

        BindAuthority.parseLines(self, lines) 
开发者ID:apple,项目名称:ccs-calendarserver,代码行数:14,代码来源:utils.py

示例6: lookupText

# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import TXT [as 别名]
def lookupText(self, name, timeout = None):
        """
        @see: twisted.names.client.lookupText
        """
        return self._lookup(name, dns.IN, dns.TXT, timeout) 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:7,代码来源:common.py

示例7: lookupText

# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import TXT [as 别名]
def lookupText(self, name, timeout = None):
        return self._lookup(name, dns.IN, dns.TXT, timeout) 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:4,代码来源:common.py

示例8: query

# 需要导入模块: from twisted.names import dns [as 别名]
# 或者: from twisted.names.dns import TXT [as 别名]
def query(self):
        d = self.resolver.query(
            dns.Query(self.hostname, type=dns.TXT))

        def cb(result):
            # Convert DNS reply into a simple list of strings.
            return [a.payload.data[0] for a in result[0]]

        d.addCallback(cb)
        return d 
开发者ID:ffledgling,项目名称:dtella,代码行数:12,代码来源:pull_dns.py


注:本文中的twisted.names.dns.TXT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。