Skip to content

Commit

Permalink
Fix method type and naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
arthepsy committed Apr 5, 2017
1 parent c132c62 commit e4bdabb
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ssh-audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ def __init__(self):
self.colors = True
self.verbose = False
self.__minlevel = 0
self.__colsupport = 'colorama' in sys.modules or os.name == 'posix'

@property
def minlevel(self):
Expand Down Expand Up @@ -226,7 +227,7 @@ def sep(self):
@property
def colors_supported(self):
# type: () -> bool
return 'colorama' in sys.modules or os.name == 'posix'
return self.__colsupport

@staticmethod
def _colorized(color):
Expand Down Expand Up @@ -1270,19 +1271,19 @@ def values(self):
@property
def maxlen(self):
# type: () -> int
def ml(items):
def _ml(items):
# type: (Sequence[text_type]) -> int
return max(len(i) for i in items)
maxlen = 0
if self.ssh1kex is not None:
maxlen = max(ml(self.ssh1kex.supported_ciphers),
ml(self.ssh1kex.supported_authentications),
maxlen = max(_ml(self.ssh1kex.supported_ciphers),
_ml(self.ssh1kex.supported_authentications),
maxlen)
if self.ssh2kex is not None:
maxlen = max(ml(self.ssh2kex.kex_algorithms),
ml(self.ssh2kex.key_algorithms),
ml(self.ssh2kex.server.encryption),
ml(self.ssh2kex.server.mac),
maxlen = max(_ml(self.ssh2kex.kex_algorithms),
_ml(self.ssh2kex.key_algorithms),
_ml(self.ssh2kex.server.encryption),
_ml(self.ssh2kex.server.mac),
maxlen)
return maxlen

Expand Down

0 comments on commit e4bdabb

Please sign in to comment.