Return True if text is a host domain name.
(text)
| 534 | |
| 535 | IPV4_RE = re.compile(r"\.\d+$", re.ASCII) |
| 536 | def is_HDN(text): |
| 537 | """Return True if text is a host domain name.""" |
| 538 | # XXX |
| 539 | # This may well be wrong. Which RFC is HDN defined in, if any (for |
| 540 | # the purposes of RFC 2965)? |
| 541 | # For the current implementation, what about IPv6? Remember to look |
| 542 | # at other uses of IPV4_RE also, if change this. |
| 543 | if IPV4_RE.search(text): |
| 544 | return False |
| 545 | if text == "": |
| 546 | return False |
| 547 | if text[0] == "." or text[-1] == ".": |
| 548 | return False |
| 549 | return True |
| 550 | |
| 551 | def domain_match(A, B): |
| 552 | """Return True if domain A domain-matches domain B, according to RFC 2965. |
searching dependent graphs…