]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
run black
authorBob Halley <halley@dnspython.org>
Thu, 30 Mar 2023 13:29:20 +0000 (06:29 -0700)
committerBob Halley <halley@dnspython.org>
Thu, 30 Mar 2023 13:29:20 +0000 (06:29 -0700)
Makefile
dns/quic/_common.py
dns/rdtypes/ANY/LOC.py
dns/rdtypes/IN/APL.py
dns/rdtypes/util.py
examples/edns.py
examples/edns_resolver.py
examples/reverse.py

index 66b4cff4364c009a9cde4feb86e29ae6c8b1945b..e0f7ccdd995e8692e053d20608ef645f19b41394 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -80,3 +80,6 @@ pokit:
 
 findjunk:
        find dns -type f | egrep -v '.*\.py' | egrep -v 'py\.typed'
+
+poblack:
+       poetry run black dns examples tests
index 625fab7f3d46f56665db20441e29d54a3e3b3b3d..442b3820a23f99fe6361f917338178a87a228301 100644 (file)
@@ -151,7 +151,7 @@ class BaseQuicManager:
             conf = aioquic.quic.configuration.QuicConfiguration(
                 alpn_protocols=["doq", "doq-i03"],
                 verify_mode=verify_mode,
-                server_name=server_name
+                server_name=server_name,
             )
             if verify_path is not None:
                 conf.load_verify_locations(verify_path)
index 52c9753267cf4785f2681d46734e8237c370bf29..028375de30e1e64f8de7e4495e59722f22686dc0 100644 (file)
@@ -40,7 +40,7 @@ def _exponent_of(what, desc):
     if what == 0:
         return 0
     exp = None
-    for (i, pow) in enumerate(_pows):
+    for i, pow in enumerate(_pows):
         if what < pow:
             exp = i - 1
             break
index 05e1689f8b4d60613419c433bc0f3e47e2fe4f1b..f1bb01db199f8e46266f8c128aa8376903d4f337 100644 (file)
@@ -124,7 +124,6 @@ class APL(dns.rdata.Rdata):
 
     @classmethod
     def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
-
         items = []
         while parser.remaining() > 0:
             header = parser.get_struct("!HBB")
index 46c98cf76f5e2fe4acbe8c197e4c570f1167fa82..54908fdc5a15f3b1b459bad6700974c562b27d17 100644 (file)
@@ -120,7 +120,7 @@ class Bitmap:
     def __init__(self, windows=None):
         last_window = -1
         self.windows = windows
-        for (window, bitmap) in self.windows:
+        for window, bitmap in self.windows:
             if not isinstance(window, int):
                 raise ValueError(f"bad {self.type_name} window type")
             if window <= last_window:
@@ -135,9 +135,9 @@ class Bitmap:
 
     def to_text(self) -> str:
         text = ""
-        for (window, bitmap) in self.windows:
+        for window, bitmap in self.windows:
             bits = []
-            for (i, byte) in enumerate(bitmap):
+            for i, byte in enumerate(bitmap):
                 for j in range(0, 8):
                     if byte & (0x80 >> j):
                         rdtype = window * 256 + i * 8 + j
@@ -183,7 +183,7 @@ class Bitmap:
         return cls(windows)
 
     def to_wire(self, file: Any) -> None:
-        for (window, bitmap) in self.windows:
+        for window, bitmap in self.windows:
             file.write(struct.pack("!BB", window, len(bitmap)))
             file.write(bitmap)
 
@@ -231,7 +231,7 @@ def weighted_processing_order(iterable):
         total = sum(rdata._processing_weight() or _no_weight for rdata in rdatas)
         while len(rdatas) > 1:
             r = random.uniform(0, total)
-            for (n, rdata) in enumerate(rdatas):
+            for n, rdata in enumerate(rdatas):
                 weight = rdata._processing_weight() or _no_weight
                 if weight > r:
                     break
index 0566bfb8988e98d531e8a7c94766d7d7e3838c2b..9738a0d0bed738de6a7130912fb36d31f938424c 100755 (executable)
@@ -60,7 +60,7 @@ q_list.append(
     (l, dns.message.make_query(n, t, options=[dns.edns.ECSOption("192.168.0.0", 20)]))
 )
 
-for (addr, q) in q_list:
+for addr, q in q_list:
     r = dns.query.udp(q, addr)
     if not r.options:
         print("No EDNS options returned")
index 6edf4a9e9a465394c0be0190efa382b64feeffa7..a43ad2525c87d75bc6367d61bead9afb51ccb36a 100644 (file)
@@ -53,7 +53,7 @@ o_list.append((l, dict(options=[dns.edns.ECSOption(external_ip, 24)])))
 
 aresolver = dns.resolver.Resolver()
 
-for (addr, edns_kwargs) in o_list:
+for addr, edns_kwargs in o_list:
     if edns_kwargs:
         aresolver.use_edns(**edns_kwargs)
     aresolver.nameservers = ["8.8.8.8"]
index 5829c6815bfb0df5eeb5fc9c0d3edd9df12a70eb..012617c25eb39e4f62451d6266e7d4d07ef8ca47 100755 (executable)
@@ -26,7 +26,7 @@ reverse_map = {}  # type: Dict[str, List[str]]
 
 for filename in sys.argv[1:]:
     zone = dns.zone.from_file(filename, os.path.basename(filename), relativize=False)
-    for (name, ttl, rdata) in zone.iterate_rdatas("A"):
+    for name, ttl, rdata in zone.iterate_rdatas("A"):
         print(type(rdata))
         try:
             reverse_map[rdata.address].append(name.to_text())