當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。