Skip to content

Commit 7f91c4c

Browse files
committed
[feature] Better dupe formatting for TXT.
1 parent d61d57e commit 7f91c4c

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

textoutputclass.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ def __frequencyoutput__(self, list):
4545
def getDateList(self):
4646
return self.__frequencyoutput__(self.analysisresults.dateFrequency)
4747

48+
def __outputdupes__(self, list):
49+
output = ''
50+
for dupes in self.analysisresults.duplicateHASHlisting: #TODO: consider count next to HASH val
51+
output = output + "Checksum: " + str(dupes['checksum']) + "\n"
52+
output = output + "Count: " + str(dupes['count']) + "\n"
53+
output = output + "Example: " + str(dupes['examples'][0]) + "\n\n"
54+
55+
return output.strip("\n")
56+
4857
def generateTEXT(self):
4958
self.printFormattedText(self.STRINGS.REPORT_TITLE)
5059
self.printFormattedText(self.STRINGS.REPORT_VERSION + ": " + self.analysisresults.__version__())
@@ -149,11 +158,8 @@ def generateTEXT(self):
149158
if self.analysisresults.hashused > 0:
150159
if self.analysisresults.totalHASHduplicates > 0:
151160
self.__output_list__(self.STRINGS.HEADING_IDENTICAL_CONTENT, self.analysisresults.totalHASHduplicates)
152-
for dupes in self.analysisresults.duplicateHASHlisting: #TODO: consider count next to HASH val
153-
self.printFormattedText("Checksum: " + str(dupes['checksum']))
154-
self.printFormattedText("Count: " + str(dupes['count']))
155-
self.printFormattedText("Example: " + str(dupes['examples'][0]) + "\n")
156-
161+
self.printFormattedText(self.__outputdupes__(self.analysisresults.duplicateHASHlisting))
162+
157163
if len(self.analysisresults.badFilenames) > 0:
158164
self.__output_list_title__(self.STRINGS.HEADING_TROUBLESOME_FILENAMES)
159165
for badnames in self.analysisresults.badFilenames:

0 commit comments

Comments
 (0)