Use os.path.join() for path manipulation in reportmodule.py,

rather than hardcoding backslash
This commit is contained in:
Ketil Froyn
2015-07-04 02:05:15 +02:00
parent 593fc2ca2d
commit 7ff99f03d8
+3 -2
View File
@@ -36,6 +36,7 @@
from java.lang import System
from org.sleuthkit.autopsy.casemodule import Case
from org.sleuthkit.autopsy.report import GeneralReportModuleAdapter
import os
# TODO: Rename this to something more specific
class SampleGeneralReportModule(GeneralReportModuleAdapter):
@@ -73,10 +74,10 @@ class SampleGeneralReportModule(GeneralReportModuleAdapter):
progressBar.increment()
# Write the result to the report file.
report = open(baseReportDir + '\\' + self.getRelativeFilePath(), 'w')
report = open(os.path.join(baseReportDir, self.getRelativeFilePath()), 'w')
report.write("file count = %d" % fileCount)
Case.getCurrentCase().addReport(report.name, "SampleGeneralReportModule", "Sample Python Report");
report.close()
progressBar.increment()
progressBar.complete()
progressBar.complete()