From 0b8e9770752eda8135cdce1a73530f1b57ea6553 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Tue, 12 Mar 2019 15:02:49 +0300 Subject: [PATCH] Introduce the ComplexOptCheck superclass --- kconfig-hardened-check.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/kconfig-hardened-check.py b/kconfig-hardened-check.py index fea5ef9..6714f05 100755 --- a/kconfig-hardened-check.py +++ b/kconfig-hardened-check.py @@ -68,16 +68,11 @@ class OptCheck: return '{} = {}'.format(self.name, self.state) -class OR: +class ComplexOptCheck: def __init__(self, *opts): self.opts = opts self.result = None - # self.opts[0] is the option which this OR-check is about. - # Use case: - # OR(, ) - # OR(, ) - @property def name(self): return self.opts[0].name @@ -98,6 +93,13 @@ class OR: def reason(self): return self.opts[0].reason + +class OR(ComplexOptCheck): + # self.opts[0] is the option which this OR-check is about. + # Use case: + # OR(, ) + # OR(, ) + def check(self): for i, opt in enumerate(self.opts): result, msg = opt.check() -- 2.31.1