Reduce return results from find_requirements.

This commit is contained in:
Mike Auty
2018-09-23 22:24:44 +01:00
parent 6c938869db
commit 00a118a06a
5 changed files with 32 additions and 22 deletions
@@ -18,8 +18,7 @@ import sys
import typing
from abc import ABCMeta, abstractmethod
from volatility.framework import constants, interfaces
from volatility.framework import validity
from volatility.framework import constants, interfaces, validity
from volatility.framework.interfaces.context import ContextInterface
CONFIG_SEPARATOR = "."
@@ -39,6 +38,11 @@ def path_join(*args) -> str:
return CONFIG_SEPARATOR.join(args)
def parent_path(value: str) -> str:
"""Returns the parent configuration path from a configuration path"""
return CONFIG_SEPARATOR.join(value.split(CONFIG_SEPARATOR)[:-1])
def path_depth(path: str, depth: int = 1) -> str:
"""Returns the `path` up to a certain depth