flake8 fixes

This commit is contained in:
Jay Townsend
2019-08-19 23:39:58 +01:00
parent 03921cac3b
commit f63b0fe837
2 changed files with 8 additions and 10 deletions
+4 -1
View File
@@ -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()
#
+4 -9
View File
@@ -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 += '<td' + \
(self.__cssBARBG and ' style="' +
self.__cssBARBG + '"' or '') + '>'
graph += '<td' + (self.__cssBARBG and ' style="' + self.__cssBARBG + '"' or '') + '>'
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 += '<table border=0 cellspacing=0 cellpadding=0><tr><td>'
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 += '</td><td width=' + \
str(int(round((100 - percent) * mul))) + '></td>'
graph += '</tr></table></td>'