mirror of
https://github.com/jtesta/ssh-audit.git
synced 2024-11-22 10:31:41 +01:00
Return level name, not level itself (make consistent with setter).
This commit is contained in:
parent
301a27ae27
commit
4b456dd01e
@ -100,7 +100,9 @@ class Output(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def minlevel(self):
|
def minlevel(self):
|
||||||
return self.__minlevel
|
if self.__minlevel < len(self.LEVELS):
|
||||||
|
return self.LEVELS[self.__minlevel]
|
||||||
|
return 'unknown'
|
||||||
|
|
||||||
@minlevel.setter
|
@minlevel.setter
|
||||||
def minlevel(self, name):
|
def minlevel(self, name):
|
||||||
@ -122,7 +124,7 @@ class Output(object):
|
|||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
if name == 'head' and self.batch:
|
if name == 'head' and self.batch:
|
||||||
return lambda x: None
|
return lambda x: None
|
||||||
if not self.getlevel(name) >= self.minlevel:
|
if not self.getlevel(name) >= self.__minlevel:
|
||||||
return lambda x: None
|
return lambda x: None
|
||||||
if self.colors and os.name == 'posix' and name in self.COLORS:
|
if self.colors and os.name == 'posix' and name in self.COLORS:
|
||||||
color = u'\033[0;{0}m'.format(self.COLORS[name])
|
color = u'\033[0;{0}m'.format(self.COLORS[name])
|
||||||
|
Loading…
Reference in New Issue
Block a user