Skip to content

Commit 509f6d1

Browse files
authored
Update ldap.py ruff fix
Signed-off-by: termanix <50464194+termanix@users.noreply.github.com>
1 parent a9181f4 commit 509f6d1

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

nxc/protocols/ldap.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,22 +1090,22 @@ def find_delegation(self):
10901090
def printTable(items, header):
10911091
colLen = []
10921092
try:
1093-
for i, col in enumerate(header):
1094-
rowMaxLen = max(len(str(row[i])) for row in items)
1095-
colLen.append(max(rowMaxLen, len(col)))
1096-
1097-
# Create the format string for each row
1098-
outputFormat = " ".join([f"{{{num}:{width}s}}" for num, width in enumerate(colLen)])
1099-
1100-
# Print header
1101-
self.logger.highlight(outputFormat.format(*header))
1102-
self.logger.highlight(" ".join(["-" * itemLen for itemLen in colLen]))
1103-
1104-
# Print rows
1105-
for row in items:
1106-
self.logger.highlight(outputFormat.format(*row))
1107-
except Exception as e:
1108-
self.logger.fail("Header Index error " + str(e)) # Seen in line rowMaxlen and highlight row variable
1093+
for i, col in enumerate(header):
1094+
rowMaxLen = max(len(str(row[i])) for row in items)
1095+
colLen.append(max(rowMaxLen, len(col)))
1096+
1097+
# Create the format string for each row
1098+
outputFormat = " ".join([f"{{{num}:{width}s}}" for num, width in enumerate(colLen)])
1099+
1100+
# Print header
1101+
self.logger.highlight(outputFormat.format(*header))
1102+
self.logger.highlight(" ".join(["-" * itemLen for itemLen in colLen]))
1103+
1104+
# Print rows
1105+
for row in items:
1106+
self.logger.highlight(outputFormat.format(*row))
1107+
except Exception as e:
1108+
self.logger.fail("Header Index error " + str(e))
11091109

11101110
# Building the search filter
11111111
search_filter = ("(&(|(UserAccountControl:1.2.840.113556.1.4.803:=16777216)(UserAccountControl:1.2.840.113556.1.4.803:="

0 commit comments

Comments
 (0)