File: generate-rdatatype-doc.py

package info (click to toggle)
dnspython 2.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,448 kB
  • sloc: python: 34,885; sh: 7; makefile: 4
file content (13 lines) | stat: -rw-r--r-- 358 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
import dns.rdatatype

print("Rdatatypes")
print("----------")
print()
by_name = {}
for rdtype in dns.rdatatype.RdataType:
    short_name = dns.rdatatype.to_text(rdtype).replace("-", "_")
    by_name[short_name] = int(rdtype)
for k in sorted(by_name.keys()):
    v = by_name[k]
    print(f".. py:data:: dns.rdatatype.{k}")
    print(f"   :annotation: = {v}")