From 8c124c5e93f28d8ca0c7c2c419fd09d639257ba1 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Sat, 28 May 2011 08:49:56 +0200 Subject: [PATCH] Replace tabs with spaces; remove trailing whitespace. --- third_party/dnspython/changelog.txt | 3 +++ third_party/dnspython/dns/edns.py | 2 +- third_party/dnspython/dns/entropy.py | 2 +- third_party/dnspython/dns/flags.py | 2 +- third_party/dnspython/dns/inet.py | 4 ++-- third_party/dnspython/dns/name.py | 2 +- third_party/dnspython/dns/opcode.py | 10 +++++----- third_party/dnspython/dns/rdtypes/ANY/LOC.py | 8 ++++---- third_party/dnspython/dns/tsigkeyring.py | 4 ++-- third_party/dnspython/tests/name.py | 6 +++--- third_party/dnspython/tests/rdtypeandclass.py | 4 ++-- third_party/dnspython/tests/rrset.py | 2 +- third_party/dnspython/tests/set.py | 2 +- third_party/dnspython/tests/zone.py | 2 +- 14 files changed, 28 insertions(+), 25 deletions(-) diff --git a/third_party/dnspython/changelog.txt b/third_party/dnspython/changelog.txt index bc743bdc..5f20212f 100644 --- a/third_party/dnspython/changelog.txt +++ b/third_party/dnspython/changelog.txt @@ -21,3 +21,6 @@ The following changes were made to the original dnspython sources: * added search patterns for domain names Changed: resolver.py + +* Replaced tabs with spaces, remove trailing whitespace. + Changed: *.py diff --git a/third_party/dnspython/dns/edns.py b/third_party/dnspython/dns/edns.py index f8b6009d..aa5135c9 100644 --- a/third_party/dnspython/dns/edns.py +++ b/third_party/dnspython/dns/edns.py @@ -114,7 +114,7 @@ class GenericOption(Option): from_wire = classmethod(from_wire) def _cmp(self, other): - return cmp(self.data, other.data) + return cmp(self.data, other.data) _type_to_class = { } diff --git a/third_party/dnspython/dns/entropy.py b/third_party/dnspython/dns/entropy.py index 7efd2e53..291dfc39 100644 --- a/third_party/dnspython/dns/entropy.py +++ b/third_party/dnspython/dns/entropy.py @@ -112,7 +112,7 @@ class EntropyPool(object): else: rand = self.random_8 max = 255 - return (first + size * rand() // (max + 1)) + return (first + size * rand() // (max + 1)) pool = EntropyPool() diff --git a/third_party/dnspython/dns/flags.py b/third_party/dnspython/dns/flags.py index 35a8305e..4cf04f85 100644 --- a/third_party/dnspython/dns/flags.py +++ b/third_party/dnspython/dns/flags.py @@ -89,7 +89,7 @@ def to_text(flags): @rtype: string""" return _to_text(flags, _by_value, _flags_order) - + def edns_from_text(text): """Convert a space-separated list of EDNS flag text values into a EDNS diff --git a/third_party/dnspython/dns/inet.py b/third_party/dnspython/dns/inet.py index 27ca5c6a..46837104 100644 --- a/third_party/dnspython/dns/inet.py +++ b/third_party/dnspython/dns/inet.py @@ -45,7 +45,7 @@ def inet_pton(family, text): implemented. @rtype: string """ - + if family == AF_INET: return dns.ipv4.inet_aton(text) elif family == AF_INET6: @@ -105,4 +105,4 @@ def is_multicast(text): return (first == 255) except StandardError: raise ValueError - + diff --git a/third_party/dnspython/dns/name.py b/third_party/dnspython/dns/name.py index ed3ffeec..3a64260c 100644 --- a/third_party/dnspython/dns/name.py +++ b/third_party/dnspython/dns/name.py @@ -552,7 +552,7 @@ def from_unicode(text, origin = root): text = u'' if text: if text == u'.': - return Name(['']) # no Unicode "u" on this constant! + return Name(['']) # no Unicode "u" on this constant! for c in text: if escaping: if edigits == 0: diff --git a/third_party/dnspython/dns/opcode.py b/third_party/dnspython/dns/opcode.py index 3258c34c..d7ba0a23 100644 --- a/third_party/dnspython/dns/opcode.py +++ b/third_party/dnspython/dns/opcode.py @@ -66,7 +66,7 @@ def from_flags(flags): @param flags: int @rtype: int """ - + return (flags & 0x7800) >> 11 def to_flags(value): @@ -74,9 +74,9 @@ def to_flags(value): flags. @rtype: int """ - + return (value << 11) & 0x7800 - + def to_text(value): """Convert an opcode to text. @@ -85,7 +85,7 @@ def to_text(value): @raises UnknownOpcode: the opcode is unknown @rtype: string """ - + text = _by_value.get(value) if text is None: text = str(value) @@ -98,7 +98,7 @@ def is_update(flags): @type flags: int @rtype: bool """ - + if (from_flags(flags) == UPDATE): return True return False diff --git a/third_party/dnspython/dns/rdtypes/ANY/LOC.py b/third_party/dnspython/dns/rdtypes/ANY/LOC.py index 154546d7..da7f0080 100644 --- a/third_party/dnspython/dns/rdtypes/ANY/LOC.py +++ b/third_party/dnspython/dns/rdtypes/ANY/LOC.py @@ -221,26 +221,26 @@ class LOC(dns.rdata.Rdata): t = tok.get_string() if t[-1] == 'm': t = t[0 : -1] - altitude = float(t) * 100.0 # m -> cm + altitude = float(t) * 100.0 # m -> cm token = tok.get().unescape() if not token.is_eol_or_eof(): value = token.value if value[-1] == 'm': value = value[0 : -1] - size = float(value) * 100.0 # m -> cm + size = float(value) * 100.0 # m -> cm token = tok.get().unescape() if not token.is_eol_or_eof(): value = token.value if value[-1] == 'm': value = value[0 : -1] - hprec = float(value) * 100.0 # m -> cm + hprec = float(value) * 100.0 # m -> cm token = tok.get().unescape() if not token.is_eol_or_eof(): value = token.value if value[-1] == 'm': value = value[0 : -1] - vprec = float(value) * 100.0 # m -> cm + vprec = float(value) * 100.0 # m -> cm tok.get_eol() return cls(rdclass, rdtype, latitude, longitude, altitude, diff --git a/third_party/dnspython/dns/tsigkeyring.py b/third_party/dnspython/dns/tsigkeyring.py index 0ddd9341..0b741583 100644 --- a/third_party/dnspython/dns/tsigkeyring.py +++ b/third_party/dnspython/dns/tsigkeyring.py @@ -23,7 +23,7 @@ def from_text(textring): """Convert a dictionary containing (textual DNS name, base64 secret) pairs into a binary keyring which has (dns.name.Name, binary secret) pairs. @rtype: dict""" - + keyring = {} for keytext in textring: keyname = dns.name.from_text(keytext) @@ -35,7 +35,7 @@ def to_text(keyring): """Convert a dictionary containing (dns.name.Name, binary secret) pairs into a text keyring which has (textual DNS name, base64 secret) pairs. @rtype: dict""" - + textring = {} for keyname in keyring: keytext = dns.name.to_text(keyname) diff --git a/third_party/dnspython/tests/name.py b/third_party/dnspython/tests/name.py index 55815f80..83216877 100644 --- a/third_party/dnspython/tests/name.py +++ b/third_party/dnspython/tests/name.py @@ -25,7 +25,7 @@ import dns.e164 class NameTestCase(unittest.TestCase): def setUp(self): self.origin = dns.name.from_text('example.') - + def testFromTextRel1(self): n = dns.name.from_text('foo.bar') self.failUnless(n.labels == ('foo', 'bar', '')) @@ -68,7 +68,7 @@ class NameTestCase(unittest.TestCase): r'..', r'.a', r'\\..', - '\\', # yes, we don't want the 'r' prefix! + '\\', # yes, we don't want the 'r' prefix! r'\0', r'\00', r'\00Z', @@ -352,7 +352,7 @@ class NameTestCase(unittest.TestCase): n = dns.name.from_text('FOO.bar', None) d = n.to_digestable(dns.name.root) self.failUnless(d == '\x03foo\x03bar\x00') - + def testBadDigestable(self): def bad(): n = dns.name.from_text('FOO.bar', None) diff --git a/third_party/dnspython/tests/rdtypeandclass.py b/third_party/dnspython/tests/rdtypeandclass.py index f3c0628d..a2660cf4 100644 --- a/third_party/dnspython/tests/rdtypeandclass.py +++ b/third_party/dnspython/tests/rdtypeandclass.py @@ -21,7 +21,7 @@ import dns.rdatatype class RdTypeAndClassTestCase(unittest.TestCase): # Classes - + def test_class_meta1(self): self.failUnless(dns.rdataclass.is_metaclass(dns.rdataclass.ANY)) @@ -66,7 +66,7 @@ class RdTypeAndClassTestCase(unittest.TestCase): self.failUnlessRaises(ValueError, bad) # Types - + def test_type_meta1(self): self.failUnless(dns.rdatatype.is_metatype(dns.rdatatype.ANY)) diff --git a/third_party/dnspython/tests/rrset.py b/third_party/dnspython/tests/rrset.py index be1324b0..2bf4c099 100644 --- a/third_party/dnspython/tests/rrset.py +++ b/third_party/dnspython/tests/rrset.py @@ -18,7 +18,7 @@ import unittest import dns.rrset class RRsetTestCase(unittest.TestCase): - + def testEqual1(self): r1 = dns.rrset.from_text('foo', 300, 'in', 'a', '10.0.0.1', '10.0.0.2') r2 = dns.rrset.from_text('FOO', 300, 'in', 'a', '10.0.0.2', '10.0.0.1') diff --git a/third_party/dnspython/tests/set.py b/third_party/dnspython/tests/set.py index 583d20cf..e85c5f6d 100644 --- a/third_party/dnspython/tests/set.py +++ b/third_party/dnspython/tests/set.py @@ -21,7 +21,7 @@ import dns.set S = dns.set.Set class SimpleSetTestCase(unittest.TestCase): - + def testLen1(self): s1 = S() self.failUnless(len(s1) == 0) diff --git a/third_party/dnspython/tests/zone.py b/third_party/dnspython/tests/zone.py index 31e7405b..d8d50955 100644 --- a/third_party/dnspython/tests/zone.py +++ b/third_party/dnspython/tests/zone.py @@ -129,7 +129,7 @@ class ZoneTestCase(unittest.TestCase): for n in names: print >> f, z[n].to_text(n) self.failUnless(f.getvalue() == example_text_output) - + def testTorture1(self): # # Read a zone containing all our supported RR types, and