From 8aeea6895ef0df80c384cf35281d6a02717f8d12 Mon Sep 17 00:00:00 2001 From: David Mougeolle Date: Tue, 7 Jan 2020 21:51:36 +0100 Subject: [PATCH] Add type annotations --- theHarvester/discovery/dnssearch.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/theHarvester/discovery/dnssearch.py b/theHarvester/discovery/dnssearch.py index 545ac62a..5282ffea 100644 --- a/theHarvester/discovery/dnssearch.py +++ b/theHarvester/discovery/dnssearch.py @@ -42,18 +42,25 @@ def process(self): results.append(host) return results + class DnsReverse: - def __init__(self, iprange, verbose=False): + def __init__( + self, + iprange: str, + verbose: bool = False) -> None: self.iprange = iprange self.verbose = verbose - def list(self): + def list( + self) -> list: prefix = '.'.join( self.iprange.split('.')[:-1]) self.list = [prefix + '.' + str(i) for i in range(256)] - def run(self, ip): + def run( + self, + ip: str) -> str: if self.verbose: esc = chr(27) sys.stdout.write(esc + '[2K' + esc + '[G') @@ -69,7 +76,8 @@ def run(self, ip): except Exception: pass - def process(self): + def process( + self) -> list: results = [] for entry in self.list: host = self.run(entry)