Drop seen_events counter from aa.py

seen_events is a global variable in aa.py that gets increased at several
places, but isn't used (read or printed) anywhere. Since I can't imagine
how it could become useful, simply drop it.

Also drop an outdated comment in handle_children that lived next to a
seen_events line.


Acked-by: Seth Arnold <seth.arnold@canonical.com>
This commit is contained in:
Christian Boltz 2016-10-14 20:24:10 +02:00
parent af6dad767f
commit 38cdaa1f6a

View file

@ -95,7 +95,6 @@ include = dict()
existing_profiles = dict()
seen_events = 0 # was our
# To store the globs entered by users so they can be provided again
# format: user_globs['/foo*'] = AARE('/foo*')
user_globs = {}
@ -1030,7 +1029,6 @@ def handle_children(profile, hat, root):
family = None
sock_type = None
protocol = None
global seen_events
regex_nullcomplain = re.compile('^null(-complain)*-profile$')
for entry in entries:
@ -1088,8 +1086,6 @@ def handle_children(profile, hat, root):
if aamode == 'PERMITTING':
q.default = 'CMD_ADDHAT'
seen_events += 1
ans = q.promptUser()[0]
if ans == 'CMD_FINISHED':
@ -1257,9 +1253,6 @@ def handle_children(profile, hat, root):
exec_toggle = False
q.functions += build_x_functions(default, options, exec_toggle)
# options = '|'.join(options)
seen_events += 1
# ask user about the exec mode to use
ans = ''
while ans not in ['CMD_ix', 'CMD_px', 'CMD_cx', 'CMD_nx', 'CMD_pix', 'CMD_cix', 'CMD_nix', 'CMD_ux', 'CMD_DENY']: # add '(I)gnore'? (hotkey conflict with '(i)x'!)
@ -1495,7 +1488,6 @@ def order_globs(globs, original_path):
def ask_the_questions():
found = 0
global seen_events
for aamode in sorted(log_dict.keys()):
# Describe the type of changes
if aamode == 'PERMITTING':
@ -1550,8 +1542,6 @@ def ask_the_questions():
else:
options.append(rule_obj.get_clean())
seen_events += 1
done = False
while not done:
q.options = options