Files
volatilityfoundation-volati…/volatility/plugins/__init__.py
T
mike.auty@gmail.com a019abed5d Fix pyinstaller plugins support.
Includes plugins in both the internal pyz, and the unpacked data
directory, in order to have dynamic loading work properly.

Also ensure that existing __path__ directories don't throw the plugin
loader off by trying to import the same plugin twice under different
namespaces.
2012-07-08 21:19:08 +00:00

19 lines
730 B
Python

import volatility.conf as conf
import volatility.constants as constants
import os
config = conf.ConfObject()
config.add_option("PLUGINS", default = "",
cache_invalidator = False,
help = "Additional plugin directories to use (colon separated)")
# Add the PLUGINPATH, in case we're frozen
__path__ = [constants.PLUGINPATH] + [ e for e in __path__ if not constants.PLUGINPATH.startswith(e) ]
# This causes the config.PLUGINS paths to be treated as extensions of the volatility.plugins package
# Meaning that each directory is search for module when import volatility.plugins.module is requested
if config.PLUGINS:
__path__.extend([ os.path.abspath(x) for x in config.PLUGINS.split(";")])