mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-07-29 15:27:46 +00:00
Remove subproject as a constructor argument
There's only one subproject and that's unlikely to change, so being able to specify a subproject at runtime is overkill. Signed-off-by: Gilles Peskine <[email protected]>
This commit is contained in:
@@ -109,18 +109,14 @@ class Internal(Checker):
|
||||
class SubprojectInternal(Checker):
|
||||
"""Checker for an internal macro of a subproject."""
|
||||
|
||||
# meant to be overridden in child classes
|
||||
# must be overridden in child classes
|
||||
SUBPROJECT = None #type: Optional[str]
|
||||
|
||||
def __init__(self, name: str, suggestion: str = '',
|
||||
subproject: Optional[str] = None) -> None:
|
||||
def __init__(self, name: str, suggestion: str = '') -> None:
|
||||
super().__init__(name, suggestion)
|
||||
if subproject is not None:
|
||||
self.subproject = subproject
|
||||
elif self.SUBPROJECT is not None:
|
||||
self.subproject = self.SUBPROJECT
|
||||
else:
|
||||
if self.SUBPROJECT is None:
|
||||
raise ValueError('No subproject specified for ' + name)
|
||||
self.subproject = self.SUBPROJECT #type: str
|
||||
|
||||
def _basic_message(self) -> str:
|
||||
return f'{self.name} is an internal macro of {self.subproject} and may not be configured.'
|
||||
@@ -150,9 +146,6 @@ class SubprojectInternal(Checker):
|
||||
class SubprojectOption(SubprojectInternal):
|
||||
"""Checker for a configuration option of a subproject."""
|
||||
|
||||
def __init__(self, name: str, subproject: Optional[str] = None) -> None:
|
||||
super().__init__(name, subproject=subproject)
|
||||
|
||||
def _basic_message(self) -> str:
|
||||
return f'{self.name} must be configured in {self.subproject}.'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user