Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rthalley/dnspython
base: master
...
head fork: uberj/dnspython
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 9 files changed
  • 4 commit comments
  • 1 contributor
Commits on Jun 29, 2012
@uberj uberj This patch adds the ability to parse '$GENERATE' statements. See test…
…s for examples.
7800613
Commits on Jun 14, 2013
@uberj uberj Merge branch 'master' of github.com:uberj/dnspython
Conflicts:
	tests/generate.py
80cd093
@uberj uberj support for parsing of comments
Not all rdtypes are covered. This patch is incomplete.
37102dd
View
14 dns/rdata.py
@@ -128,9 +128,9 @@ class Rdata(object):
"""Base class for all DNS rdata types.
"""
- __slots__ = ['rdclass', 'rdtype']
+ __slots__ = ['rdclass', 'rdtype', 'comment']
- def __init__(self, rdclass, rdtype):
+ def __init__(self, rdclass, rdtype, comment=None):
"""Initialize an rdata.
@param rdclass: The rdata class
@type rdclass: int
@@ -140,6 +140,7 @@ def __init__(self, rdclass, rdtype):
self.rdclass = rdclass
self.rdtype = rdtype
+ self.comment = comment
def covers(self):
"""DNS SIG/RRSIG rdatas apply to a specific type; this type is
@@ -476,3 +477,12 @@ def from_wire(rdclass, rdtype, wire, current, rdlen, origin = None):
wire = dns.wiredata.maybe_wrap(wire)
cls = get_rdata_class(rdclass, rdtype)
return cls.from_wire(rdclass, rdtype, wire, current, rdlen, origin)
+
+
+def with_comment(tok, rd):
+ token = tok.get(want_comment=True)
+ if token.is_comment():
+ rd.comment = token.value
+ else:
+ tok.unget(token)
+ return rd
View
3  dns/rdtypes/IN/A.py
@@ -37,8 +37,9 @@ def to_text(self, origin=None, relativize=True, **kw):
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
address = tok.get_identifier()
+ rd = dns.rdata.with_comment(tok, cls(rdclass, rdtype, address))
tok.get_eol()
- return cls(rdclass, rdtype, address)
+ return rd
from_text = classmethod(from_text)
View
3  dns/rdtypes/IN/AAAA.py
@@ -37,8 +37,9 @@ def to_text(self, origin=None, relativize=True, **kw):
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
address = tok.get_identifier()
+ rd = dns.rdata.with_comment(tok, cls(rdclass, rdtype, address))
tok.get_eol()
- return cls(rdclass, rdtype, address)
+ return rd
from_text = classmethod(from_text)
View
3  dns/rdtypes/IN/SRV.py
@@ -52,8 +52,9 @@ def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
port = tok.get_uint16()
target = tok.get_name(None)
target = target.choose_relativity(origin, relativize)
+ rd = dns.rdata.with_comment(tok, cls(rdclass, rdtype, priority, weight, port, target))
tok.get_eol()
- return cls(rdclass, rdtype, priority, weight, port, target)
+ return rd
from_text = classmethod(from_text)
View
3  dns/rdtypes/mxbase.py
@@ -45,8 +45,9 @@ def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
preference = tok.get_uint16()
exchange = tok.get_name()
exchange = exchange.choose_relativity(origin, relativize)
+ rd = dns.rdata.with_comment(tok, cls(rdclass, rdtype, preference, exchange))
tok.get_eol()
- return cls(rdclass, rdtype, preference, exchange)
+ return rd
from_text = classmethod(from_text)
View
4 dns/rdtypes/nsbase.py
@@ -32,6 +32,7 @@ class NSBase(dns.rdata.Rdata):
def __init__(self, rdclass, rdtype, target):
super(NSBase, self).__init__(rdclass, rdtype)
self.target = target
+ self.comment = ''
def to_text(self, origin=None, relativize=True, **kw):
target = self.target.choose_relativity(origin, relativize)
@@ -40,8 +41,9 @@ def to_text(self, origin=None, relativize=True, **kw):
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
target = tok.get_name()
target = target.choose_relativity(origin, relativize)
+ rd = dns.rdata.with_comment(tok, cls(rdclass, rdtype, target))
tok.get_eol()
- return cls(rdclass, rdtype, target)
+ return rd
from_text = classmethod(from_text)
View
3  dns/zone.py
@@ -20,6 +20,9 @@
import sys
import re
+import sys
+import re
+
import dns.exception
import dns.name
import dns.node
View
0  tests/_trial_temp/_trial_marker
No changes.
View
2  tests/_trial_temp/test.log
@@ -0,0 +1,2 @@
+2012-05-23 09:53:07-0700 [-] Log opened.
+2012-05-23 09:53:07-0700 [-] using set_wakeup_fd

Showing you all comments on commits in this comparison.

@lucab

I suspect this file (and parent dir as well), was not really intended to be committed...

@uberj

You are correct. If these features are in-deeded wanted I can recommit without it.

@lucab

Yes, thanks. I stress-tested it as I had to handle 3000+ zone, now I'd like to request upstream author to merge it.

Something went wrong with that request. Please try again.