Fix up input validation and start the CLI code.

This commit is contained in:
Mike Auty
2015-04-07 17:27:57 -05:00
parent 3385b05dc8
commit e013455f40
3 changed files with 15 additions and 3 deletions
+12
View File
@@ -1 +1,13 @@
__author__ = 'mike'
import volatility.framework
class CommandLine():
def __init__(self):
pass
def run(self):
sys.stdout.write("Volatility Framework 3 (version "+ "{0}.{1}.{2}".format(volatility.framework.version()) + ")")
def main():
CommandLine().run()
+1 -1
View File
@@ -54,7 +54,7 @@ class TranslationLayerInput(GenericInput):
"""Validate that the value is a valid layer name and that the layer adheres to the requirements"""
if value not in context.memory:
raise IndexError(value + " is not memory layer")
class ChoiceInput(GenericInput):
"""Allows one from a choice of strings
+2 -2
View File
@@ -33,8 +33,8 @@ class PluginInterface(validity.ValidityRoutines, metaclass = ABCMeta):
def context(self):
return self._context
@abstractmethod
@classmethod
@abstractmethod
def inputs(cls):
"""Returns a list of requirements options"""
return []
@@ -46,7 +46,7 @@ class PluginInterface(validity.ValidityRoutines, metaclass = ABCMeta):
def validate_inputs(self):
for option in self.inputs():
option.validate_input(option.value, self.context)
option.validate_input(self.get_input(option.name).value, self.context)
@abstractmethod
def __call__(self):