summaryrefslogtreecommitdiff
path: root/dns
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2020-08-19 16:14:24 -0700
committerBob Halley <halley@dnspython.org>2020-08-19 16:14:24 -0700
commitbccfd05f2b89adcb379fcebb7d0c4140aca4a6fb (patch)
treefbfcea9cb28d4c97f7f8c0a4c97c8483220adfa8 /dns
parent65c4a968686dd0c3bca1ed1a5fd13fa0d2f1b441 (diff)
downloaddnspython-bccfd05f2b89adcb379fcebb7d0c4140aca4a6fb.tar.gz
rename masterfile to zonefile
Diffstat (limited to 'dns')
-rw-r--r--dns/__init__.py2
-rw-r--r--dns/rdataset.py2
-rw-r--r--dns/rrset.py2
-rw-r--r--dns/tokenizer.py6
-rw-r--r--dns/transaction.py2
-rw-r--r--dns/versioned.py2
-rw-r--r--dns/zone.py20
-rw-r--r--dns/zonefile.py (renamed from dns/masterfile.py)10
8 files changed, 23 insertions, 23 deletions
diff --git a/dns/__init__.py b/dns/__init__.py
index eafdcc4..3a51a53 100644
--- a/dns/__init__.py
+++ b/dns/__init__.py
@@ -31,7 +31,6 @@ __all__ = [
'inet',
'ipv4',
'ipv6',
- 'masterfile',
'message',
'name',
'namedict',
@@ -60,6 +59,7 @@ __all__ = [
'versioned',
'wire',
'zone',
+ 'zonefile',
]
from dns.version import version as __version__ # noqa
diff --git a/dns/rdataset.py b/dns/rdataset.py
index 10cb252..2a42e42 100644
--- a/dns/rdataset.py
+++ b/dns/rdataset.py
@@ -178,7 +178,7 @@ class Rdataset(dns.set.Set):
def to_text(self, name=None, origin=None, relativize=True,
override_rdclass=None, want_comments=False, **kw):
- """Convert the rdataset into DNS master file format.
+ """Convert the rdataset into DNS zone file format.
See ``dns.name.Name.choose_relativity`` for more information
on how *origin* and *relativize* determine the way names
diff --git a/dns/rrset.py b/dns/rrset.py
index 5a09352..adfcad9 100644
--- a/dns/rrset.py
+++ b/dns/rrset.py
@@ -92,7 +92,7 @@ class RRset(dns.rdataset.Rdataset):
def to_text(self, origin=None, relativize=True,
**kw):
- """Convert the RRset into DNS master file format.
+ """Convert the RRset into DNS zone file format.
See ``dns.name.Name.choose_relativity`` for more information
on how *origin* and *relativize* determine the way names
diff --git a/dns/tokenizer.py b/dns/tokenizer.py
index 131d428..7ddc7a9 100644
--- a/dns/tokenizer.py
+++ b/dns/tokenizer.py
@@ -15,7 +15,7 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-"""Tokenize DNS master file format"""
+"""Tokenize DNS zone file format"""
import io
import sys
@@ -41,7 +41,7 @@ class UngetBufferFull(dns.exception.DNSException):
class Token:
- """A DNS master file format token.
+ """A DNS zone file format token.
ttype: The token type
value: The token value
@@ -191,7 +191,7 @@ class Token:
class Tokenizer:
- """A DNS master file format tokenizer.
+ """A DNS zone file format tokenizer.
A token object is basically a (type, value) tuple. The valid
types are EOF, EOL, WHITESPACE, IDENTIFIER, QUOTED_STRING,
diff --git a/dns/transaction.py b/dns/transaction.py
index eae2920..db32e9d 100644
--- a/dns/transaction.py
+++ b/dns/transaction.py
@@ -472,7 +472,7 @@ class Transaction:
This method is called when reading a possibly relativized
source, and an origin setting operation occurs (e.g. $ORIGIN
- in a masterfile).
+ in a zone file).
"""
raise NotImplementedError # pragma: no cover
diff --git a/dns/versioned.py b/dns/versioned.py
index 99c30e4..ff3d702 100644
--- a/dns/versioned.py
+++ b/dns/versioned.py
@@ -181,7 +181,7 @@ class Zone(dns.zone.Zone):
*origin* is the origin of the zone. It may be a ``dns.name.Name``,
a ``str``, or ``None``. If ``None``, then the zone's origin will
- be set by the first ``$ORIGIN`` line in a masterfile.
+ be set by the first ``$ORIGIN`` line in a zone file.
*rdclass*, an ``int``, the zone's rdata class; the default is class IN.
diff --git a/dns/zone.py b/dns/zone.py
index 11c4c33..39ab1a6 100644
--- a/dns/zone.py
+++ b/dns/zone.py
@@ -22,7 +22,6 @@ import io
import os
import dns.exception
-import dns.masterfile
import dns.name
import dns.node
import dns.rdataclass
@@ -34,6 +33,7 @@ import dns.tokenizer
import dns.transaction
import dns.ttl
import dns.grange
+import dns.zonefile
class BadZone(dns.exception.DNSException):
@@ -77,7 +77,7 @@ class Zone(dns.transaction.TransactionManager):
*origin* is the origin of the zone. It may be a ``dns.name.Name``,
a ``str``, or ``None``. If ``None``, then the zone's origin will
- be set by the first ``$ORIGIN`` line in a masterfile.
+ be set by the first ``$ORIGIN`` line in a zone file.
*rdclass*, an ``int``, the zone's rdata class; the default is class IN.
@@ -761,13 +761,13 @@ class Transaction(dns.transaction.Transaction):
def from_text(text, origin=None, rdclass=dns.rdataclass.IN,
relativize=True, zone_factory=Zone, filename=None,
allow_include=False, check_origin=True, idna_codec=None):
- """Build a zone object from a master file format string.
+ """Build a zone object from a zone file format string.
- *text*, a ``str``, the master file format input.
+ *text*, a ``str``, the zone file format input.
*origin*, a ``dns.name.Name``, a ``str``, or ``None``. The origin
of the zone; if not specified, the first ``$ORIGIN`` statement in the
- masterfile will determine the origin of the zone.
+ zone file will determine the origin of the zone.
*rdclass*, an ``int``, the zone's rdata class; the default is class IN.
@@ -811,11 +811,11 @@ def from_text(text, origin=None, rdclass=dns.rdataclass.IN,
zone = zone_factory(origin, rdclass, relativize=relativize)
with zone.writer(True) as txn:
tok = dns.tokenizer.Tokenizer(text, filename, idna_codec=idna_codec)
- reader = dns.masterfile.Reader(tok, rdclass, txn,
- allow_include=allow_include)
+ reader = dns.zonefile.Reader(tok, rdclass, txn,
+ allow_include=allow_include)
try:
reader.read()
- except dns.masterfile.UnknownOrigin:
+ except dns.zonefile.UnknownOrigin:
# for backwards compatibility
raise dns.zone.UnknownOrigin
# Now that we're done reading, do some basic checking of the zone.
@@ -827,14 +827,14 @@ def from_text(text, origin=None, rdclass=dns.rdataclass.IN,
def from_file(f, origin=None, rdclass=dns.rdataclass.IN,
relativize=True, zone_factory=Zone, filename=None,
allow_include=True, check_origin=True):
- """Read a master file and build a zone object.
+ """Read a zone file and build a zone object.
*f*, a file or ``str``. If *f* is a string, it is treated
as the name of a file to open.
*origin*, a ``dns.name.Name``, a ``str``, or ``None``. The origin
of the zone; if not specified, the first ``$ORIGIN`` statement in the
- masterfile will determine the origin of the zone.
+ zone file will determine the origin of the zone.
*rdclass*, an ``int``, the zone's rdata class; the default is class IN.
diff --git a/dns/masterfile.py b/dns/zonefile.py
index 66bb6a3..df2d01c 100644
--- a/dns/masterfile.py
+++ b/dns/zonefile.py
@@ -40,7 +40,7 @@ class UnknownOrigin(dns.exception.DNSException):
class Reader:
- """Read a DNS master file into a transaction."""
+ """Read a DNS zone file into a transaction."""
def __init__(self, tok, rdclass, txn, allow_include=False):
self.tok = tok
@@ -64,7 +64,7 @@ class Reader:
break
def _rr_line(self):
- """Process one line from a DNS master file."""
+ """Process one line from a DNS zone file."""
# Name
if self.current_origin is None:
raise UnknownOrigin
@@ -197,7 +197,7 @@ class Reader:
def _generate_line(self):
# range lhs [ttl] [class] type rhs [ comment ]
"""Process one line containing the GENERATE statement from a DNS
- master file."""
+ zone file."""
if self.current_origin is None:
raise UnknownOrigin
@@ -312,7 +312,7 @@ class Reader:
self.txn.add(name, ttl, rd)
def read(self):
- """Read a DNS master file and build a zone object.
+ """Read a DNS zone file and build a zone object.
@raises dns.zone.NoSOA: No SOA RR was found at the zone origin
@raises dns.zone.NoNS: No NS RRset was found at the zone origin
@@ -386,7 +386,7 @@ class Reader:
self._generate_line()
else:
raise dns.exception.SyntaxError(
- "Unknown master file directive '" + c + "'")
+ "Unknown zone file directive '" + c + "'")
continue
self.tok.unget(token)
self._rr_line()