Convert to using ABCMeta to get abstract class failures immediately rather than on method use.

This commit is contained in:
Mike Auty
2014-04-14 02:21:13 +01:00
parent c5156c25cb
commit 3da8bdf28a
5 changed files with 38 additions and 21 deletions
+6 -2
View File
@@ -1,15 +1,18 @@
'''
"""
Created on 6 May 2013
@author: mike
'''
"""
import copy
from volatility.framework import validity
from volatility.framework.interfaces import context as context_module
from abc import ABCMeta, abstractmethod
class ObjectInterface(validity.ValidityRoutines):
""" A base object required to be the ancestor of every object used in volatility """
__metaclass__ = ABCMeta
def __init__(self, context, layer_name, offset, structure_name, size, parent = None):
# Since objects are likely to be instantiated often,
# we're only checking that context, offset and parent
@@ -26,6 +29,7 @@ class ObjectInterface(validity.ValidityRoutines):
self._structure_name = structure_name
self._size = size
@abstractmethod
def write(self, value):
"""Writes the new value into the format at the offset the object currently resides at"""