From 79beb2daa162429dfc71ccff8be88ce6ab7295e6 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Mon, 14 Feb 2022 21:23:58 +0300 Subject: [PATCH] Add 'type' for PresenceCheck and VersionCheck --- kconfig_hardened_check/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index 1e3b94d..02d0281 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -128,6 +128,10 @@ class VersionCheck: self.ver = () self.result = None + @property + def type(self): + return 'version' + def check(self): if self.ver[0] > self.ver_expected[0]: self.result = 'OK: version >= ' + str(self.ver_expected[0]) + '.' + str(self.ver_expected[1]) @@ -150,7 +154,8 @@ class VersionCheck: class PresenceCheck: def __init__(self, name, type): - if type == 'kconfig': + self.type = type + if self.type == 'kconfig': self.name = 'CONFIG_' + name else: self.name = name -- 2.31.1