Introduce the ComplexOptCheck superclass
authorAlexander Popov <alex.popov@linux.com>
Tue, 12 Mar 2019 12:02:49 +0000 (15:02 +0300)
committerAlexander Popov <alex.popov@linux.com>
Tue, 12 Mar 2019 12:02:49 +0000 (15:02 +0300)
kconfig-hardened-check.py

index fea5ef958b6eeec515cc9172cea07e825f6e86ca..6714f0570beed84adf26d54e6ad08b9017644bae 100755 (executable)
@@ -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(<X_is_hardened>, <X_is_disabled>)
-    #     OR(<X_is_hardened>, <X_is_hardened_old>)
-
     @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(<X_is_hardened>, <X_is_disabled>)
+    #     OR(<X_is_hardened>, <X_is_hardened_old>)
+
     def check(self):
         for i, opt in enumerate(self.opts):
             result, msg = opt.check()