mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-06 17:57:38 +02:00
Convert to using ABCMeta to get abstract class failures immediately rather than on method use.
This commit is contained in:
@@ -3,6 +3,7 @@ Created on 6 May 2013
|
||||
|
||||
@author: mike
|
||||
"""
|
||||
from abc import abstractmethod, ABCMeta
|
||||
|
||||
from volatility.framework import validity
|
||||
from volatility.framework.interfaces import context as context_module
|
||||
@@ -10,6 +11,7 @@ from volatility.framework.interfaces import context as context_module
|
||||
|
||||
class PluginInterface(validity.ValidityRoutines):
|
||||
"""Class that defines the interface all Plugins must maintain"""
|
||||
__metaclass__ = ABCMeta
|
||||
|
||||
def __init__(self, context):
|
||||
self.type_check(context, context_module.ContextInterface)
|
||||
@@ -19,17 +21,18 @@ class PluginInterface(validity.ValidityRoutines):
|
||||
def context(self):
|
||||
return self._context
|
||||
|
||||
@abstractmethod
|
||||
def establish_context(self):
|
||||
"""Alters the context to ensure the plugin can run.
|
||||
|
||||
This function constructs the necessary address spaces and symbol spaces that the plugin will need.
|
||||
"""
|
||||
raise NotImplementedError("Abstract method establish_context must be overridden by plugins.")
|
||||
|
||||
@abstractmethod
|
||||
def plugin_options(self, config_group = None):
|
||||
"""Modifies the passed in ConfigGroup object to contain the required options"""
|
||||
raise NotImplementedError("Abstract method plugin_options must be overridden by plugins")
|
||||
|
||||
@abstractmethod
|
||||
def __call__(self, context):
|
||||
"""Executes the functionality of the code
|
||||
|
||||
|
||||
Reference in New Issue
Block a user