1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

target/KernelConfig: Implement the __bool__ method

To aid in checking whether any information is contained in the
`KernelConfig` ensure that that `__bool__` method value indicated the
presence of parsed input.
This commit is contained in:
Marc Bonnici 2019-07-17 11:46:55 +01:00 committed by setrofim
parent f141899dae
commit 1325e59b1a

View File

@ -2020,6 +2020,9 @@ class KernelConfig(object):
# Expose the original text for backward compatibility # Expose the original text for backward compatibility
self.text = text self.text = text
def __bool__(self):
return bool(self.typed_config)
not_set_regex = TypedKernelConfig.not_set_regex not_set_regex = TypedKernelConfig.not_set_regex
def iteritems(self): def iteritems(self):