Try to combine some if statements
This commit is contained in:
@@ -44,9 +44,8 @@ class Airmon(object):
|
||||
p = Process('airmon-ng')
|
||||
for line in p.stdout().split('\n'):
|
||||
# Ignore blank/header lines
|
||||
if len(line) == 0: continue
|
||||
if line.startswith('Interface'): continue
|
||||
if line.startswith('PHY'): continue
|
||||
if len(line) == 0 or line.startswith('Interface') or line.startswith('PHY'):
|
||||
continue
|
||||
|
||||
# Strip out interface information
|
||||
fields = line.split("\t")
|
||||
@@ -242,8 +241,8 @@ class Airmon(object):
|
||||
if re.search('^ *PID', line):
|
||||
hit_pids = True
|
||||
continue
|
||||
if not hit_pids: continue
|
||||
if line.strip() == '': continue
|
||||
if not hit_pids or line.strip() == '':
|
||||
continue
|
||||
match = re.search('^[ \t]*(\d+)[ \t]*([a-zA-Z0-9_\-]+)[ \t]*$', line)
|
||||
if match:
|
||||
# Found process to kill
|
||||
|
||||
@@ -120,9 +120,7 @@ class Airodump(object):
|
||||
|
||||
# Remove .cap and .xor files from pwd
|
||||
for fil in os.listdir('.'):
|
||||
if fil.startswith('replay_') and fil.endswith('.cap'):
|
||||
os.remove(fil)
|
||||
if fil.endswith('.xor'):
|
||||
if fil.startswith('replay_') and fil.endswith('.cap') or fil.endswith('.xor'):
|
||||
os.remove(fil)
|
||||
|
||||
def get_targets(self, apply_filter=True):
|
||||
|
||||
@@ -321,9 +321,8 @@ class Configuration(object):
|
||||
result += Color.s('{W}%s------------------{W}\n' % ('-' * max_len))
|
||||
|
||||
for (key,val) in sorted(Configuration.__dict__.iteritems()):
|
||||
if key.startswith('__'): continue
|
||||
if type(val) == staticmethod: continue
|
||||
if val is None: continue
|
||||
if key.startswith('__') or type(val) == staticmethod or val is None:
|
||||
continue
|
||||
result += Color.s("{G}%s {W} {C}%s{W}\n" % (key.ljust(max_len),val))
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user