source: trunk/server/lib/dnspython/examples/name.py

Last change on this file was 745, checked in by Silvan Scherrer, 13 years ago

Samba Server: updated trunk to 3.6.0

File size: 436 bytes
Line 
1#!/usr/bin/env python
2
3import dns.name
4
5n = dns.name.from_text('www.dnspython.org')
6o = dns.name.from_text('dnspython.org')
7print n.is_subdomain(o) # True
8print n.is_superdomain(o) # False
9print n > o # True
10rel = n.relativize(o) # rel is the relative name www
11n2 = rel + o
12print n2 == n # True
13print n.labels # ['www', 'dnspython', 'org', '']
Note: See TracBrowser for help on using the repository browser.