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 |
|
---|
3 | import dns.name
|
---|
4 |
|
---|
5 | n = dns.name.from_text('www.dnspython.org')
|
---|
6 | o = dns.name.from_text('dnspython.org')
|
---|
7 | print n.is_subdomain(o) # True
|
---|
8 | print n.is_superdomain(o) # False
|
---|
9 | print n > o # True
|
---|
10 | rel = n.relativize(o) # rel is the relative name www
|
---|
11 | n2 = rel + o
|
---|
12 | print n2 == n # True
|
---|
13 | print n.labels # ['www', 'dnspython', 'org', '']
|
---|
Note:
See
TracBrowser
for help on using the repository browser.