From ce3ebdcbb8e107073eb35e39cf22faf80c544770 Mon Sep 17 00:00:00 2001 From: dv Date: Mon, 2 Mar 2015 20:49:33 +0800 Subject: [PATCH] clean Tab --- dns/edns.py | 2 +- dns/entropy.py | 2 +- dns/name.py | 2 +- dns/rdtypes/ANY/LOC.py | 8 ++++---- examples/ddns.py | 14 +++++++------- examples/reverse.py | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dns/edns.py b/dns/edns.py index e52b6df3..cf062d06 100644 --- a/dns/edns.py +++ b/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/dns/entropy.py b/dns/entropy.py index d380cf8c..1ffbc7b9 100644 --- a/dns/entropy.py +++ b/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/dns/name.py b/dns/name.py index 9e17cddf..4cd48a12 100644 --- a/dns/name.py +++ b/dns/name.py @@ -562,7 +562,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/dns/rdtypes/ANY/LOC.py b/dns/rdtypes/ANY/LOC.py index 6cc55217..73bf79ef 100644 --- a/dns/rdtypes/ANY/LOC.py +++ b/dns/rdtypes/ANY/LOC.py @@ -231,26 +231,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/examples/ddns.py b/examples/ddns.py index 84814b73..f351524e 100755 --- a/examples/ddns.py +++ b/examples/ddns.py @@ -12,15 +12,15 @@ # # E.g. on my systems I have this # -# #!/bin/sh +# #!/bin/sh # -# DEVICE=$1 +# DEVICE=$1 # -# if [ "X${DEVICE}" == "Xeth0" ]; then -# IPADDR=`LANG= LC_ALL= ifconfig ${DEVICE} | grep 'inet addr' | -# awk -F: '{ print $2 } ' | awk '{ print $1 }'` -# /usr/local/sbin/ddns.py $IPADDR -# fi +# if [ "X${DEVICE}" == "Xeth0" ]; then +# IPADDR=`LANG= LC_ALL= ifconfig ${DEVICE} | grep 'inet addr' | +# awk -F: '{ print $2 } ' | awk '{ print $1 }'` +# /usr/local/sbin/ddns.py $IPADDR +# fi # # in /etc/ifup-local. # diff --git a/examples/reverse.py b/examples/reverse.py index 8657baed..9de5a30b 100755 --- a/examples/reverse.py +++ b/examples/reverse.py @@ -28,9 +28,9 @@ for filename in sys.argv[1:]: relativize=False) for (name, ttl, rdata) in zone.iterate_rdatas('A'): try: - reverse_map[rdata.address].append(name.to_text()) - except KeyError: - reverse_map[rdata.address] = [name.to_text()] + reverse_map[rdata.address].append(name.to_text()) + except KeyError: + reverse_map[rdata.address] = [name.to_text()] keys = reverse_map.keys() keys.sort(lambda a1, a2: cmp(dns.ipv4.inet_aton(a1), dns.ipv4.inet_aton(a2))) -- 2.47.3