Start building a dependency resolver for translation layers.

This commit is contained in:
Mike Auty
2015-12-29 22:13:10 +00:00
parent f7cc2ef00e
commit cf66d0b447
6 changed files with 56 additions and 135 deletions
-11
View File
@@ -1,7 +1,6 @@
# TODO: Code to import all the py/pyc files available (but not both).
# TODO: Code to return a none-instantiated list of plugin classes.
import inspect
import logging
import os
import sys
@@ -11,16 +10,6 @@ import volatility.plugins as plugins
logger = logging.getLogger(__name__)
def class_subclasses(cls):
"""Returns all the (recursive) subclasses of a given class"""
if not inspect.isclass(cls):
raise TypeError(repr(cls) + " is not a class.")
for clazz in cls.__subclasses__():
yield clazz
for return_value in class_subclasses(clazz):
yield return_value
def import_plugins():
"""Imports all plugins present under plugins path"""
if not isinstance(plugins.__path__, list):