From f63b0fe837855f98b4e7cedff5d1aee7f7eaefca Mon Sep 17 00:00:00 2001 From: Jay Townsend Date: Mon, 19 Aug 2019 23:39:58 +0100 Subject: [PATCH] flake8 fixes --- theHarvester/discovery/DNS/Lib.py | 5 ++++- theHarvester/lib/graphs.py | 13 ++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/theHarvester/discovery/DNS/Lib.py b/theHarvester/discovery/DNS/Lib.py index 3d996756..fd1c8642 100644 --- a/theHarvester/discovery/DNS/Lib.py +++ b/theHarvester/discovery/DNS/Lib.py @@ -25,6 +25,7 @@ from theHarvester.discovery.DNS import Type, Class, Opcode, Status from theHarvester.discovery.DNS.Base import DNSError + class UnpackError(DNSError): pass @@ -34,6 +35,7 @@ class PackError(DNSError): # Low-level 16 and 32 bit integer packing and unpacking + from struct import pack as struct_pack from struct import unpack as struct_unpack from socket import inet_ntoa, inet_aton @@ -420,7 +422,7 @@ class RRunpacker(Unpacker): ttl = self.get32bit() rdlength = self.get16bit() self.rdend = self.offset + rdlength - return (name, rrtype, klass, ttl, rdlength) + return name, rrtype, klass, ttl, rdlength def endRR(self): if self.offset != self.rdend: @@ -694,6 +696,7 @@ def dumpRR(u): else: print(' binary rdata:', u.getbytes(rdlength)) + if __name__ == "__main__": testpacker() # diff --git a/theHarvester/lib/graphs.py b/theHarvester/lib/graphs.py index 480555be..6e25f1b9 100644 --- a/theHarvester/lib/graphs.py +++ b/theHarvester/lib/graphs.py @@ -674,15 +674,11 @@ class BarGraph: value = _number_format(v[i][0], max_dec) if self.showValues == 1 or self.showValues == 2: - graph += self.build_value(v[i] - [0], max_dec, sum, 'right') + graph += self.build_value(v[i][0], max_dec, sum, 'right') - graph += '' + graph += '' - self.barColors = ( - len(drc) >= i + 1) and drc[i].strip() or self.__colors[0] + self.barColors = (len(drc) >= i + 1) and drc[i].strip() or self.__colors[0] bColor = self.level_color(v[i][0], self.barColors) graph += '' graph += '
' if self.type == 'fader': @@ -690,8 +686,7 @@ class BarGraph: value, int(round(self.barWidth / 2)), self.barWidth, int(round(percent * mul)), bColor) else: - graph += self.build_bar(value, - int(round(percent * mul)), self.barWidth, bColor) + graph += self.build_bar(value, int(round(percent * mul)), self.barWidth, bColor) graph += '
'