Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 29, 2024
1 parent e8c5c3d commit 27eabbe
Show file tree
Hide file tree
Showing 19 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions ldaptor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A Pure-Python Twisted library for LDAP"""

__version__ = "21.2.1.dev0"

__title__ = "ldaptor"
Expand Down
2 changes: 1 addition & 1 deletion ldaptor/_scripts/ldap2dhcpconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions ldaptor/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions ldaptor/ldiftree.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Manage LDAP data as a tree of LDIF files.
"""

import errno
import os
import uuid
Expand Down
1 change: 1 addition & 0 deletions ldaptor/protocols/ldap/ldapsyntax.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Pythonic API for LDAP operations."""

import functools

from twisted.internet import defer
Expand Down
2 changes: 1 addition & 1 deletion ldaptor/protocols/ldap/merger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
1 change: 1 addition & 0 deletions ldaptor/protocols/ldap/proxybase.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions ldaptor/test/test_attributeset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test cases for ldaptor.attributeset
"""

from functools import total_ordering

from twisted.trial import unittest
Expand Down
1 change: 1 addition & 0 deletions ldaptor/test/test_autofill_samba.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test cases for ldaptor.protocols.ldap.autofill.sambaAccount module.
"""

from twisted.trial import unittest

from ldaptor.protocols.ldap import ldapsyntax
Expand Down
1 change: 1 addition & 0 deletions ldaptor/test/test_examples.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests for the code from docs/source/example.
"""

import os
import sys

Expand Down
1 change: 1 addition & 0 deletions ldaptor/test/test_inmemory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test cases for ldaptor.inmemory module.
"""

from io import BytesIO

from twisted.trial import unittest
Expand Down
1 change: 1 addition & 0 deletions ldaptor/test/test_ldapclient.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions ldaptor/test/test_match.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test cases for ldaptor.protocols.ldap.ldapserver module.
"""

import re

import attr
Expand Down
1 change: 1 addition & 0 deletions ldaptor/test/test_proxybase.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test cases for ldaptor.protocols.ldap.proxybase module.
"""

from functools import partial
import itertools

Expand Down
5 changes: 3 additions & 2 deletions ldaptor/test/test_pureber.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test cases for ldaptor.protocols.pureber module.
"""

from twisted.trial import unittest

from ldaptor.protocols import pureber
Expand Down Expand Up @@ -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):
Expand All @@ -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]
Expand Down
1 change: 1 addition & 0 deletions ldaptor/test/test_pureldap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test cases for ldaptor.protocols.pureldap module.
"""

from twisted.trial import unittest

from ldaptor.protocols import pureldap, pureber
Expand Down
1 change: 1 addition & 0 deletions ldaptor/test/test_server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test cases for ldaptor.protocols.ldap.ldapserver module.
"""

import base64
import types

Expand Down
1 change: 1 addition & 0 deletions ldaptor/test/test_usage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test cases for ldaptor.usage
"""

import re

from twisted.python.usage import UsageError
Expand Down
1 change: 1 addition & 0 deletions ldaptor/usage.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 27eabbe

Please sign in to comment.