Commit 6b00badf authored by Vincent Pelletier's avatar Vincent Pelletier

Match skipped user agents as regexes instead of verbatim.

This change introduces a (minor) parameter value backward-incompatibility.
parent b42f842a
......@@ -1421,7 +1421,8 @@ def main():
per_site[site] = site_stats
print('done (%s)' % timedelta(seconds=time.time() - load_start),
file=sys.stderr)
skip_user_agent = list(itertools.chain(*args.skip_user_agent))
skip_user_agent = [re.compile(x).match
for x in itertools.chain(*args.skip_user_agent)]
malformed_lines = 0
skipped_lines = 0
no_url_lines = 0
......@@ -1460,7 +1461,8 @@ def main():
file=sys.stderr)
malformed_lines += 1
continue
if match.group('agent') in skip_user_agent:
agent = match.group('agent')
if any(x(agent) for x in skip_user_agent):
skipped_user_agent += 1
continue
url_match = matchrequest(match.group('request'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment