Skip to content

Commit 48a05ba

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0f28ec5 commit 48a05ba

19 files changed

+22
-6
lines changed

ldaptor/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""A Pure-Python Twisted library for LDAP"""
2+
23
__version__ = "21.2.1.dev0"
34

45
__title__ = "ldaptor"

ldaptor/_scripts/ldap2dhcpconf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def my_aton_numbits(num):
3030
n = 0
3131
while num > 0:
3232
n >>= 1
33-
n |= 2 ** 31
33+
n |= 2**31
3434
num -= 1
3535
return n
3636

ldaptor/dns.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def aton_numbits(num):
1313
n = 0
1414
while num > 0:
1515
n >>= 1
16-
n |= 2 ** 31
16+
n |= 2**31
1717
num -= 1
1818
return n
1919

@@ -35,7 +35,7 @@ def ntoa(n):
3535

3636
def netmaskToNumbits(netmask):
3737
bits = aton(netmask)
38-
i = 2 ** 31
38+
i = 2**31
3939
n = 0
4040
while bits and i > 0:
4141
if (bits & i) == 0:

ldaptor/ldiftree.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Manage LDAP data as a tree of LDIF files.
33
"""
4+
45
import errno
56
import os
67
import uuid

ldaptor/protocols/ldap/ldapsyntax.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Pythonic API for LDAP operations."""
2+
23
import functools
34

45
from twisted.internet import defer

ldaptor/protocols/ldap/merger.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def queue(self, id, op):
8282

8383
def connectionMade(self):
8484
clientCreator = ldapconnector.LDAPClientCreator(reactor, self.protocol)
85-
for (c, tls) in zip(self.configs, self.use_tls):
85+
for c, tls in zip(self.configs, self.use_tls):
8686
d = clientCreator.connect(dn="", overrides=c.getServiceLocationOverrides())
8787
if tls:
8888
d.addCallback(lambda x: x.startTLS())

ldaptor/protocols/ldap/proxybase.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
LDAP protocol proxy server.
33
"""
4+
45
from ldaptor.protocols.ldap import ldapserver, ldapconnector, ldaperrors
56
from ldaptor.protocols import pureldap
67
from twisted.internet import defer

ldaptor/test/test_attributeset.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Test cases for ldaptor.attributeset
33
"""
4+
45
from functools import total_ordering
56

67
from twisted.trial import unittest

ldaptor/test/test_autofill_samba.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Test cases for ldaptor.protocols.ldap.autofill.sambaAccount module.
33
"""
4+
45
from twisted.trial import unittest
56

67
from ldaptor.protocols.ldap import ldapsyntax

ldaptor/test/test_examples.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Tests for the code from docs/source/example.
33
"""
4+
45
import os
56
import sys
67

ldaptor/test/test_inmemory.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Test cases for ldaptor.inmemory module.
33
"""
4+
45
from io import BytesIO
56

67
from twisted.trial import unittest

ldaptor/test/test_ldapclient.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Test cases for ldaptor.protocols.ldap.ldapsyntax module.
33
"""
4+
45
from twisted.trial import unittest
56
from twisted.test import proto_helpers
67
from twisted.internet import defer

ldaptor/test/test_match.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Test cases for ldaptor.protocols.ldap.ldapserver module.
33
"""
4+
45
import re
56

67
import attr

ldaptor/test/test_proxybase.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Test cases for ldaptor.protocols.ldap.proxybase module.
33
"""
4+
45
from functools import partial
56
import itertools
67

ldaptor/test/test_pureber.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Test cases for ldaptor.protocols.pureber module.
33
"""
4+
45
from twisted.trial import unittest
56

67
from ldaptor.protocols import pureber
@@ -34,7 +35,7 @@ class BerLengths(unittest.TestCase):
3435
(257, [0x80 | 2, 1, 1]),
3536
(65535, [0x80 | 2, 0xFF, 0xFF]),
3637
(65536, [0x80 | 3, 0x01, 0x00, 0x00]),
37-
(256 ** 127 - 1, [0x80 | 127] + 127 * [0xFF]),
38+
(256**127 - 1, [0x80 | 127] + 127 * [0xFF]),
3839
)
3940

4041
def testToBER(self):
@@ -61,7 +62,7 @@ def testPartialBER(self):
6162
pureber.BERExceptionInsufficientData, pureber.berDecodeLength, m[:1]
6263
)
6364

64-
m = bytes(pureber.int2berlen(256 ** 100 - 1))
65+
m = bytes(pureber.int2berlen(256**100 - 1))
6566
self.assertEqual(101, len(m))
6667
self.assertRaises(
6768
pureber.BERExceptionInsufficientData, pureber.berDecodeLength, m[:100]

ldaptor/test/test_pureldap.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Test cases for ldaptor.protocols.pureldap module.
33
"""
4+
45
from twisted.trial import unittest
56

67
from ldaptor.protocols import pureldap, pureber

ldaptor/test/test_server.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Test cases for ldaptor.protocols.ldap.ldapserver module.
33
"""
4+
45
import base64
56
import types
67

ldaptor/test/test_usage.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Test cases for ldaptor.usage
33
"""
4+
45
import re
56

67
from twisted.python.usage import UsageError

ldaptor/usage.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Command line argument/options available to various ldaptor tools.
33
"""
4+
45
from twisted.python import usage, reflect
56
from twisted.python.usage import UsageError
67
from ldaptor.protocols import pureldap

0 commit comments

Comments
 (0)