]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
rename masterfile to zonefile
authorBob Halley <halley@dnspython.org>
Wed, 19 Aug 2020 23:14:24 +0000 (16:14 -0700)
committerBob Halley <halley@dnspython.org>
Wed, 19 Aug 2020 23:14:24 +0000 (16:14 -0700)
dns/__init__.py
dns/rdataset.py
dns/rrset.py
dns/tokenizer.py
dns/transaction.py
dns/versioned.py
dns/zone.py
dns/zonefile.py [moved from dns/masterfile.py with 98% similarity]

index eafdcc4d539d2b6fdca4ee8d48c011262e7d3a16..3a51a539183ce2c6ecaa88beaf2e5e7cb0e8157e 100644 (file)
@@ -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
index 10cb252fa9864dce254186ab6947f59f175be7bb..2a42e424279f8b6d8592638f0b6e4a39c58d9acd 100644 (file)
@@ -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
index 5a09352e9a6e967b17bae4fc159c41ca2ab62c93..adfcad9d863495dfacdebe9a72b160c78daa1077 100644 (file)
@@ -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
index 131d428bbda647b59b592932c4cfbd1458375e45..7ddc7a96893cf31dca4f52c0c1ccfc1637301422 100644 (file)
@@ -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,
index eae2920c009c28c1e710a70bec05661e2f7605b7..db32e9dc7ee376216afc4f096466a78981099a24 100644 (file)
@@ -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
 
index 99c30e49b5695070bef9f27991b60e01b0fec3f8..ff3d7020d3c3f6abcf43a6f4a757e03521441f21 100644 (file)
@@ -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.
 
index 11c4c336b6a32b98dbc130339fb27f89180fb17d..39ab1a60346767aa7ef681dc29c1cdec4a7e695c 100644 (file)
@@ -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.
 
similarity index 98%
rename from dns/masterfile.py
rename to dns/zonefile.py
index 66bb6a3a790d31ac50bb01f22e77659e1932be9d..df2d01cace56fbd85cbc95d06baa40caa2812c3b 100644 (file)
@@ -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()