mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-08-30 11:49:42 +02:00
Allow the optional setting of requirements to be changed (for sub-plugins).
This commit is contained in:
@@ -223,7 +223,7 @@ class CommandLine(object):
|
||||
# Construct an argparse group
|
||||
|
||||
for requirement in configurable.get_requirements():
|
||||
additional = {}
|
||||
additional = {} # typing.Dict[str, typing.Any]
|
||||
if not isinstance(requirement, interfaces.configuration.RequirementInterface):
|
||||
raise TypeError(
|
||||
"Plugin contains requirements that are not RequirementInterfaces: {}".format(configurable.__name__))
|
||||
|
||||
@@ -274,6 +274,11 @@ class RequirementInterface(validity.ValidityRoutines, metaclass = ABCMeta):
|
||||
"""Whether the Requirement is optional or not"""
|
||||
return self._optional
|
||||
|
||||
@optional.setter
|
||||
def optional(self, value) -> None:
|
||||
"""Sets the optional value for a requirement"""
|
||||
self._optional = bool(value)
|
||||
|
||||
def config_value(self,
|
||||
context: interfaces.context.ContextInterface,
|
||||
config_path: str,
|
||||
|
||||
Reference in New Issue
Block a user