Core: Fix LGTM recommendations

This is mostly unused imports and unused variables.
This commit is contained in:
Mike Auty
2020-11-04 22:41:39 +00:00
parent 7c75018fc4
commit 0a655d76a8
29 changed files with 68 additions and 103 deletions
+2 -11
View File
@@ -11,27 +11,18 @@ import functools
import logging
import math
import multiprocessing
import multiprocessing.managers
import threading
import traceback
import types
from abc import ABCMeta, abstractmethod
from multiprocessing import managers
from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Tuple, Union
from volatility.framework import constants, exceptions, interfaces
vollog = logging.getLogger(__name__)
IMPORTED_MAGIC = False
try:
import magic
IMPORTED_MAGIC = True
vollog.debug("Imported python-magic, autodetecting compressed files based on content")
except ImportError:
pass
ProgressValue = Union['DummyProgress', managers.ValueProxy]
ProgressValue = Union['DummyProgress', multiprocessing.managers.ValueProxy]
IteratorValue = Tuple[List[Tuple[str, int, int]], int]
+6 -7
View File
@@ -7,7 +7,6 @@ import abc
import collections
import collections.abc
import logging
from abc import ABCMeta, abstractmethod
from typing import Any, Dict, List, Mapping, Optional
from volatility.framework import constants, interfaces
@@ -88,7 +87,7 @@ class ObjectInformation(ReadOnlyMapping):
})
class ObjectInterface(metaclass = ABCMeta):
class ObjectInterface(metaclass = abc.ABCMeta):
"""A base object required to be the ancestor of every object used in
volatility."""
@@ -129,7 +128,7 @@ class ObjectInterface(metaclass = ABCMeta):
# Wrap the outgoing vol in a read-only proxy
return ReadOnlyMapping(self._vol)
@abstractmethod
@abc.abstractmethod
def write(self, value: Any):
"""Writes the new value into the format at the offset the object
currently resides at."""
@@ -296,20 +295,20 @@ class Template:
return []
@property
@abstractmethod
@abc.abstractmethod
def size(self) -> int:
"""Returns the size of the template."""
@abstractmethod
@abc.abstractmethod
def relative_child_offset(self, child: str) -> int:
"""Returns the relative offset of the `child` member from its parent
offset."""
@abstractmethod
@abc.abstractmethod
def replace_child(self, old_child: 'Template', new_child: 'Template') -> None:
"""Replaces `old_child` with `new_child` in the list of children."""
@abstractmethod
@abc.abstractmethod
def has_member(self, member_name: str) -> bool:
"""Returns whether the object would contain a member called
`member_name`"""