diff --git a/ldaptor/__init__.py b/ldaptor/__init__.py index ac6a38d7..296fe3a9 100644 --- a/ldaptor/__init__.py +++ b/ldaptor/__init__.py @@ -1,4 +1,5 @@ """A Pure-Python Twisted library for LDAP""" + __version__ = "21.2.1.dev0" __title__ = "ldaptor" diff --git a/ldaptor/_scripts/ldap2dhcpconf.py b/ldaptor/_scripts/ldap2dhcpconf.py index a589e02c..992e8d2e 100644 --- a/ldaptor/_scripts/ldap2dhcpconf.py +++ b/ldaptor/_scripts/ldap2dhcpconf.py @@ -30,7 +30,7 @@ def my_aton_numbits(num): n = 0 while num > 0: n >>= 1 - n |= 2 ** 31 + n |= 2**31 num -= 1 return n diff --git a/ldaptor/dns.py b/ldaptor/dns.py index 0005e93e..710b3824 100644 --- a/ldaptor/dns.py +++ b/ldaptor/dns.py @@ -13,7 +13,7 @@ def aton_numbits(num): n = 0 while num > 0: n >>= 1 - n |= 2 ** 31 + n |= 2**31 num -= 1 return n @@ -35,7 +35,7 @@ def ntoa(n): def netmaskToNumbits(netmask): bits = aton(netmask) - i = 2 ** 31 + i = 2**31 n = 0 while bits and i > 0: if (bits & i) == 0: diff --git a/ldaptor/ldiftree.py b/ldaptor/ldiftree.py index c97738c1..7d2dff0a 100644 --- a/ldaptor/ldiftree.py +++ b/ldaptor/ldiftree.py @@ -1,6 +1,7 @@ """ Manage LDAP data as a tree of LDIF files. """ + import errno import os import uuid diff --git a/ldaptor/protocols/ldap/ldapsyntax.py b/ldaptor/protocols/ldap/ldapsyntax.py index 120e3411..1760d9f5 100644 --- a/ldaptor/protocols/ldap/ldapsyntax.py +++ b/ldaptor/protocols/ldap/ldapsyntax.py @@ -1,4 +1,5 @@ """Pythonic API for LDAP operations.""" + import functools from twisted.internet import defer diff --git a/ldaptor/protocols/ldap/merger.py b/ldaptor/protocols/ldap/merger.py index 7efc7573..3f716afe 100644 --- a/ldaptor/protocols/ldap/merger.py +++ b/ldaptor/protocols/ldap/merger.py @@ -82,7 +82,7 @@ def queue(self, id, op): def connectionMade(self): clientCreator = ldapconnector.LDAPClientCreator(reactor, self.protocol) - for (c, tls) in zip(self.configs, self.use_tls): + for c, tls in zip(self.configs, self.use_tls): d = clientCreator.connect(dn="", overrides=c.getServiceLocationOverrides()) if tls: d.addCallback(lambda x: x.startTLS()) diff --git a/ldaptor/protocols/ldap/proxybase.py b/ldaptor/protocols/ldap/proxybase.py index d4b7b827..c1610f86 100755 --- a/ldaptor/protocols/ldap/proxybase.py +++ b/ldaptor/protocols/ldap/proxybase.py @@ -1,6 +1,7 @@ """ LDAP protocol proxy server. """ + from ldaptor.protocols.ldap import ldapserver, ldapconnector, ldaperrors from ldaptor.protocols import pureldap from twisted.internet import defer diff --git a/ldaptor/test/test_attributeset.py b/ldaptor/test/test_attributeset.py index c02747f8..e39185dc 100644 --- a/ldaptor/test/test_attributeset.py +++ b/ldaptor/test/test_attributeset.py @@ -1,6 +1,7 @@ """ Test cases for ldaptor.attributeset """ + from functools import total_ordering from twisted.trial import unittest diff --git a/ldaptor/test/test_autofill_samba.py b/ldaptor/test/test_autofill_samba.py index 6910d79c..ad44252e 100644 --- a/ldaptor/test/test_autofill_samba.py +++ b/ldaptor/test/test_autofill_samba.py @@ -1,6 +1,7 @@ """ Test cases for ldaptor.protocols.ldap.autofill.sambaAccount module. """ + from twisted.trial import unittest from ldaptor.protocols.ldap import ldapsyntax diff --git a/ldaptor/test/test_examples.py b/ldaptor/test/test_examples.py index ecb10d42..5b0201dc 100644 --- a/ldaptor/test/test_examples.py +++ b/ldaptor/test/test_examples.py @@ -1,6 +1,7 @@ """ Tests for the code from docs/source/example. """ + import os import sys diff --git a/ldaptor/test/test_inmemory.py b/ldaptor/test/test_inmemory.py index 78e9b22e..ff1ff6cc 100644 --- a/ldaptor/test/test_inmemory.py +++ b/ldaptor/test/test_inmemory.py @@ -1,6 +1,7 @@ """ Test cases for ldaptor.inmemory module. """ + from io import BytesIO from twisted.trial import unittest diff --git a/ldaptor/test/test_ldapclient.py b/ldaptor/test/test_ldapclient.py index 3c9ad8d4..2e593238 100644 --- a/ldaptor/test/test_ldapclient.py +++ b/ldaptor/test/test_ldapclient.py @@ -1,6 +1,7 @@ """ Test cases for ldaptor.protocols.ldap.ldapsyntax module. """ + from twisted.trial import unittest from twisted.test import proto_helpers from twisted.internet import defer diff --git a/ldaptor/test/test_match.py b/ldaptor/test/test_match.py index ccc524f2..bbed166d 100644 --- a/ldaptor/test/test_match.py +++ b/ldaptor/test/test_match.py @@ -1,6 +1,7 @@ """ Test cases for ldaptor.protocols.ldap.ldapserver module. """ + import re import attr diff --git a/ldaptor/test/test_proxybase.py b/ldaptor/test/test_proxybase.py index 6516cd76..f5181282 100644 --- a/ldaptor/test/test_proxybase.py +++ b/ldaptor/test/test_proxybase.py @@ -1,6 +1,7 @@ """ Test cases for ldaptor.protocols.ldap.proxybase module. """ + from functools import partial import itertools diff --git a/ldaptor/test/test_pureber.py b/ldaptor/test/test_pureber.py index ea4633c9..f1a02950 100644 --- a/ldaptor/test/test_pureber.py +++ b/ldaptor/test/test_pureber.py @@ -1,6 +1,7 @@ """ Test cases for ldaptor.protocols.pureber module. """ + from twisted.trial import unittest from ldaptor.protocols import pureber @@ -34,7 +35,7 @@ class BerLengths(unittest.TestCase): (257, [0x80 | 2, 1, 1]), (65535, [0x80 | 2, 0xFF, 0xFF]), (65536, [0x80 | 3, 0x01, 0x00, 0x00]), - (256 ** 127 - 1, [0x80 | 127] + 127 * [0xFF]), + (256**127 - 1, [0x80 | 127] + 127 * [0xFF]), ) def testToBER(self): @@ -61,7 +62,7 @@ def testPartialBER(self): pureber.BERExceptionInsufficientData, pureber.berDecodeLength, m[:1] ) - m = bytes(pureber.int2berlen(256 ** 100 - 1)) + m = bytes(pureber.int2berlen(256**100 - 1)) self.assertEqual(101, len(m)) self.assertRaises( pureber.BERExceptionInsufficientData, pureber.berDecodeLength, m[:100] diff --git a/ldaptor/test/test_pureldap.py b/ldaptor/test/test_pureldap.py index 6bdd4d8d..2c3c5acb 100644 --- a/ldaptor/test/test_pureldap.py +++ b/ldaptor/test/test_pureldap.py @@ -1,6 +1,7 @@ """ Test cases for ldaptor.protocols.pureldap module. """ + from twisted.trial import unittest from ldaptor.protocols import pureldap, pureber diff --git a/ldaptor/test/test_server.py b/ldaptor/test/test_server.py index c65d8ab7..e3b64f3b 100644 --- a/ldaptor/test/test_server.py +++ b/ldaptor/test/test_server.py @@ -1,6 +1,7 @@ """ Test cases for ldaptor.protocols.ldap.ldapserver module. """ + import base64 import types diff --git a/ldaptor/test/test_usage.py b/ldaptor/test/test_usage.py index 90425168..2086d411 100644 --- a/ldaptor/test/test_usage.py +++ b/ldaptor/test/test_usage.py @@ -1,6 +1,7 @@ """ Test cases for ldaptor.usage """ + import re from twisted.python.usage import UsageError diff --git a/ldaptor/usage.py b/ldaptor/usage.py index 03669cfd..2c3f39cf 100644 --- a/ldaptor/usage.py +++ b/ldaptor/usage.py @@ -1,6 +1,7 @@ """ Command line argument/options available to various ldaptor tools. """ + from twisted.python import usage, reflect from twisted.python.usage import UsageError from ldaptor.protocols import pureldap