From: Alexander Popov Date: Mon, 14 Feb 2022 18:23:58 +0000 (+0300) Subject: Add 'type' for PresenceCheck and VersionCheck X-Git-Tag: v0.5.17~30^2~3 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=79beb2daa162429dfc71ccff8be88ce6ab7295e6;p=kconfig-hardened-check.git Add 'type' for PresenceCheck and VersionCheck --- 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