Skip to content

Commit 6c6273b

Browse files
committed
Fix PEP8 problems
1 parent 13145de commit 6c6273b

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

scapy/layers/ldap.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
import struct
2727
import uuid
2828

29-
from enum import Enum
30-
3129
from scapy.arch import get_if_addr
3230
from scapy.ansmachine import AnsweringMachine
3331
from scapy.asn1.asn1 import (

scapy/utils.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3682,7 +3682,8 @@ def addcommand(
36823682
"""
36833683
Decorator to register a command
36843684
3685-
:param mono: if True, the command takes a single argument even if there are spaces
3685+
:param mono: if True, the command takes a single argument even
3686+
if there are spaces.
36863687
"""
36873688
def func(cmd: DecoratorCallable) -> DecoratorCallable:
36883689
cmd.cliutil_type = _CLIUtilMetaclass.TYPE.COMMAND # type: ignore
@@ -3788,7 +3789,7 @@ def _args(func: Any) -> str:
37883789
)
37893790
)
37903791

3791-
def _split_cmd(self, cmd: str):
3792+
def _split_cmd(self, cmd: str) -> Tuple[List[str], List[int]]:
37923793
"""
37933794
Split the command in multiple arguments
37943795
"""
@@ -3846,10 +3847,10 @@ def get_completions(cmpl, document, complete_event): # type: ignore
38463847
args, _, _ = self._parseallargs(self.commands[cmd], cmd, parts[1:])
38473848
if cmd in self.commands_complete:
38483849
completer = self.commands_complete[cmd]
3849-
# If the completion is 'mono', it's a single argument with spaces.
3850-
# Else we pass the list of arguments to complete, and we only complete
3851-
# the last argument.
3852-
if completer._mono:
3850+
# If the completion is 'mono', it's a single argument with
3851+
# spaces. Else we pass the list of arguments to complete,
3852+
# and we only complete the last argument.
3853+
if completer._mono: # type: ignore
38533854
arg = " ".join(args)
38543855
completions = completer(self, arg)
38553856
startpos = offsets[1]
@@ -3859,8 +3860,9 @@ def get_completions(cmpl, document, complete_event): # type: ignore
38593860

38603861
# For each possible completion
38613862
for possible_arg in completions:
3862-
# If there's a space in the completion, and we're not in mono mode, add quotes
3863-
if " " in possible_arg and not completer._mono:
3863+
# If there's a space in the completion, and we're
3864+
# not in mono mode, add quotes.
3865+
if " " in possible_arg and not completer._mono: # type: ignore # noqa: E501
38643866
possible_arg = '"%s"' % possible_arg
38653867

38663868
yield Completion(

0 commit comments

Comments
 (0)