Code cleanup

This commit is contained in:
derv82
2018-04-18 14:42:24 -04:00
parent 8f32972546
commit 2b40ce3706
9 changed files with 333 additions and 279 deletions

View File

@@ -4,9 +4,7 @@
import time
class Attack(object):
'''
Contains functionality common to all attacks
'''
'''Contains functionality common to all attacks.'''
target_wait = 20
@@ -17,17 +15,13 @@ class Attack(object):
raise Exception("Unimplemented method: run")
def wait_for_target(self, airodump):
'''
Waits for target to appear in airodump
'''
'''Waits for target to appear in airodump.'''
start_time = time.time()
targets = airodump.get_targets(apply_filter=False)
while len(targets) == 0:
# Wait for target to appear in airodump.
if int(time.time() - start_time) > Attack.target_wait:
raise Exception(
"Target did not appear after %d seconds, stopping"
% Attack.target_wait)
raise Exception('Target did not appear after %d seconds, stopping' % Attack.target_wait)
time.sleep(1)
targets = airodump.get_targets()
continue