mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-27 20:14:51 +02:00
Fix up direct import issue
This commit is contained in:
@@ -9,11 +9,10 @@ import random
|
||||
import string
|
||||
import sys
|
||||
from functools import wraps
|
||||
from typing import Any, Callable, Dict, List, Tuple, TypeVar, Union
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union
|
||||
from volatility3.cli import text_filter
|
||||
|
||||
from volatility3.framework import exceptions, interfaces, renderers
|
||||
from volatility3.framework.interfaces.renderers import BaseAbsentValue
|
||||
from volatility3.framework.renderers import format_hints
|
||||
|
||||
vollog = logging.getLogger(__name__)
|
||||
@@ -84,7 +83,9 @@ def multitypedata_as_text(value: format_hints.MultiTypeData) -> str:
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
def optional(func: Callable[[Union[BaseAbsentValue, T]], str]) -> Callable[[T], str]:
|
||||
def optional(
|
||||
func: Callable[[Union[interfaces.renderers.BaseAbsentValue, T]], str],
|
||||
) -> Callable[[T], str]:
|
||||
@wraps(func)
|
||||
def wrapped(x: Any) -> str:
|
||||
if isinstance(x, interfaces.renderers.BaseAbsentValue):
|
||||
@@ -156,8 +157,10 @@ class LayerDataRenderer(CLITypeRenderer):
|
||||
self.display_hex = True
|
||||
self.display_ascii = True
|
||||
|
||||
def render(data: Union[renderers.LayerData, BaseAbsentValue]):
|
||||
if isinstance(data, BaseAbsentValue):
|
||||
def render(
|
||||
data: Union[renderers.LayerData, interfaces.renderers.BaseAbsentValue],
|
||||
):
|
||||
if isinstance(data, interfaces.renderers.BaseAbsentValue):
|
||||
# FIXME: Do something cleverer here
|
||||
return ""
|
||||
|
||||
@@ -241,8 +244,8 @@ class CLIRenderer(interfaces.renderers.Renderer):
|
||||
|
||||
name = "unnamed"
|
||||
structured_output = False
|
||||
filter: text_filter.CLIFilter = None
|
||||
column_hide_list: list = None
|
||||
filter: Optional[text_filter.CLIFilter] = None
|
||||
column_hide_list: Optional[list] = None
|
||||
|
||||
def ignored_columns(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user