From ef501a61f26ba66c06a90cddfcc41d45e012c344 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Thu, 31 Mar 2016 16:48:31 -0400 Subject: [PATCH] Revert "Remove code to search InternalPythonModules from python/JythonModuleLoader" This reverts commit 6d2c46593266dc99b88bc37480a1830f96a62632. --- .../autopsy/python/JythonModuleLoader.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/python/JythonModuleLoader.java b/Core/src/org/sleuthkit/autopsy/python/JythonModuleLoader.java index e2ed871a11..c9175f3754 100755 --- a/Core/src/org/sleuthkit/autopsy/python/JythonModuleLoader.java +++ b/Core/src/org/sleuthkit/autopsy/python/JythonModuleLoader.java @@ -68,11 +68,19 @@ public final class JythonModuleLoader { } private static List getInterfaceImplementations(LineFilter filter, Class interfaceClass) { - PythonInterpreter interpreter = new PythonInterpreter(); List objects = new ArrayList<>(); - File pythonModulesDir = new File(PlatformUtil.getUserPythonModulesPath()); - File[] files = pythonModulesDir.listFiles(); - for (File file : files) { + Set pythonModuleDirs = new HashSet<>(); + PythonInterpreter interpreter = new PythonInterpreter(); + + // add python modules from 'autospy/build/cluster/InternalPythonModules' folder + // which are copied from 'autopsy/*/release/InternalPythonModules' folders. + for (File f : InstalledFileLocator.getDefault().locateAll("InternalPythonModules", JythonModuleLoader.class.getPackage().getName(), false)) { //NON-NLS + Collections.addAll(pythonModuleDirs, f.listFiles()); + } + // add python modules from 'testuserdir/python_modules' folder + Collections.addAll(pythonModuleDirs, new File(PlatformUtil.getUserPythonModulesPath()).listFiles()); + + for (File file : pythonModuleDirs) { if (file.isDirectory()) { File[] pythonScripts = file.listFiles(new PythonScriptFileFilter()); for (File script : pythonScripts) {