mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-08-22 22:32:22 +02:00
Bring relative_child_offset typing in line with practice.
This commit is contained in:
@@ -456,9 +456,9 @@ class Array(interfaces.objects.ObjectInterface, abc.Sequence):
|
||||
@classmethod
|
||||
def relative_child_offset(cls,
|
||||
template: interfaces.objects.Template,
|
||||
child: interfaces.objects.Template) -> int:
|
||||
child: str) -> int:
|
||||
"""Returns the relative offset from the head of the parent data to the child member"""
|
||||
if 'subtype' in template and child == 'subtype':
|
||||
if 'subtype' in template.vol and child == 'subtype':
|
||||
return 0
|
||||
raise IndexError("Member not present in array template: {}".format(child))
|
||||
|
||||
@@ -551,7 +551,7 @@ class Struct(interfaces.objects.ObjectInterface):
|
||||
@classmethod
|
||||
def relative_child_offset(cls,
|
||||
template: interfaces.objects.Template,
|
||||
child: interfaces.objects.Template) -> int:
|
||||
child: str) -> int:
|
||||
"""Returns the relative offset of a child to its parent"""
|
||||
retlist = template.vol.members.get(child, None)
|
||||
if retlist is None:
|
||||
|
||||
@@ -36,7 +36,7 @@ class ObjectTemplate(interfaces.objects.Template, validity.ValidityRoutines):
|
||||
"""
|
||||
return self.vol.object_class.VolTemplateProxy.children(self)
|
||||
|
||||
def relative_child_offset(self, child: interfaces.objects.Template) -> int:
|
||||
def relative_child_offset(self, child: str) -> int:
|
||||
"""Returns the relative offset of a child of the templated object (see :class:`~volatility.framework.interfaces.objects.ObjectInterface.VolTemplateProxy`)
|
||||
"""
|
||||
return self.vol.object_class.VolTemplateProxy.relative_child_offset(self, child)
|
||||
|
||||
Reference in New Issue
Block a user