Core: Implement the ability to cache from the CLI

This commit is contained in:
Mike Auty
2020-12-30 17:48:07 +00:00
parent a876414357
commit f2ac496e22
3 changed files with 17 additions and 0 deletions
+2
View File
@@ -10,6 +10,8 @@ from typing import List, TypeVar, Callable, Any, Optional
_T = TypeVar("_T")
_S = TypeVar("_S")
CACHING = True
class classproperty(property):
"""Class property decorator.
+6
View File
@@ -22,6 +22,11 @@ import traceback
from typing import Dict, Type, Union, Any
from urllib import parse, request
import volatility
if "--live" in sys.argv:
volatility.CACHING = False
import volatility.plugins
import volatility.symbols
from volatility import framework
@@ -134,6 +139,7 @@ class CommandLine:
help = "Log output to a file as well as the console",
default = None,
type = str)
parser.add_argument("--live", help = "Disable caching of layer reads", action = 'store_true')
parser.add_argument("-o",
"--output-dir",
help = "Directory in which to output any generated files",
+9
View File
@@ -0,0 +1,9 @@
import functools
import volatility
def lru_cache(*args, **kwargs):
if not volatility.CACHING:
return lambda x: x
raise Exception
return functools.lru_cache(*args, **kwargs)