mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-28 04:24:53 +02:00
Fix up TreeGrid typing information in places.
This commit is contained in:
@@ -130,9 +130,9 @@ class TreeGrid(object, metaclass = ABCMeta):
|
||||
@abstractmethod
|
||||
def populate(self,
|
||||
func: VisitorSignature = None,
|
||||
initial_accumulator: typing.Any = None) \
|
||||
-> typing.Generator[typing.Tuple[SimpleTypes, ...], None, None]:
|
||||
"""Generator that returns the next available Node
|
||||
initial_accumulator: typing.Any = None) -> None:
|
||||
"""Populates the tree by consuming the TreeGrid's construction generator
|
||||
Func is called on every node, so can be used to create output on demand
|
||||
|
||||
This is equivalent to a one-time visit.
|
||||
"""
|
||||
|
||||
@@ -168,8 +168,7 @@ class TreeGrid(interfaces.renderers.TreeGrid):
|
||||
|
||||
def populate(self,
|
||||
func: interfaces.renderers.VisitorSignature = None,
|
||||
initial_accumulator: typing.Any = None) \
|
||||
-> typing.Generator[typing.Tuple[interfaces.renderers.SimpleTypes, ...], None, None]:
|
||||
initial_accumulator: typing.Any = None) -> None:
|
||||
"""Populates the tree by consuming the TreeGrid's construction generator
|
||||
Func is called on every node, so can be used to create output on demand
|
||||
|
||||
@@ -190,7 +189,6 @@ class TreeGrid(interfaces.renderers.TreeGrid):
|
||||
accumulator = func(treenode, accumulator)
|
||||
self._row_count += 1
|
||||
self._populated = True
|
||||
return None
|
||||
|
||||
@property
|
||||
def populated(self):
|
||||
@@ -263,7 +261,7 @@ class TreeGrid(interfaces.renderers.TreeGrid):
|
||||
_T = typing.TypeVar("_T")
|
||||
|
||||
def visit(self,
|
||||
node: interfaces.renderers.TreeNode,
|
||||
node: typing.Optional[interfaces.renderers.TreeNode],
|
||||
function: typing.Callable[[interfaces.renderers.TreeNode, _T], _T],
|
||||
initial_accumulator: _T = None,
|
||||
sort_key: interfaces.renderers.ColumnSortKey = None):
|
||||
|
||||
Reference in New Issue
Block a user