Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: sitescripts/stats/bin/logprocessor.py

Issue 29340823: Issue 3737 - Parse user agent strings from MS Edge (Closed)
Patch Set: Created April 25, 2016, 3:19 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | sitescripts/stats/test/logprocessor.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # coding: utf-8 1 # coding: utf-8
2 2
3 # This file is part of the Adblock Plus web scripts, 3 # This file is part of the Adblock Plus web scripts,
4 # Copyright (C) 2006-2016 Eyeo GmbH 4 # Copyright (C) 2006-2016 Eyeo GmbH
5 # 5 #
6 # Adblock Plus is free software: you can redistribute it and/or modify 6 # Adblock Plus is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 3 as 7 # it under the terms of the GNU General Public License version 3 as
8 # published by the Free Software Foundation. 8 # published by the Free Software Foundation.
9 # 9 #
10 # Adblock Plus is distributed in the hope that it will be useful, 10 # Adblock Plus is distributed in the hope that it will be useful,
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 if match and re.search(r"\bGecko/", ua): 183 if match and re.search(r"\bGecko/", ua):
184 if match.group(3) and int(match.group(1)) < 2: 184 if match.group(3) and int(match.group(1)) < 2:
185 return "Gecko", "%s.%s.%s" % (match.group(1), match.group(2), match. group(3)) 185 return "Gecko", "%s.%s.%s" % (match.group(1), match.group(2), match. group(3))
186 else: 186 else:
187 return "Gecko", "%s.%s" % (match.group(1), match.group(2)) 187 return "Gecko", "%s.%s" % (match.group(1), match.group(2))
188 188
189 match = re.search(r"\bCoolNovo/(\d+\.\d+\.\d+)", ua) 189 match = re.search(r"\bCoolNovo/(\d+\.\d+\.\d+)", ua)
190 if match: 190 if match:
191 return "CoolNovo", match.group(1) 191 return "CoolNovo", match.group(1)
192 192
193 match = re.search(r"\bEdge/(\d+)\.\d+", ua)
194 if match:
195 return "Edge", match.group(1)
196
193 match = re.search(r"\bChrome/(\d+\.\d+)", ua) 197 match = re.search(r"\bChrome/(\d+\.\d+)", ua)
194 if match: 198 if match:
195 return "Chrome", match.group(1) 199 return "Chrome", match.group(1)
196 200
197 match = re.search(r"\bVersion/(\d+\.\d+)", ua) 201 match = re.search(r"\bVersion/(\d+\.\d+)", ua)
198 if match and re.search(r"\bMobile Safari/", ua): 202 if match and re.search(r"\bMobile Safari/", ua):
199 return "Mobile Safari", match.group(1) 203 return "Mobile Safari", match.group(1)
200 if match and re.search(r"\bSafari/", ua): 204 if match and re.search(r"\bSafari/", ua):
201 return "Safari", match.group(1) 205 return "Safari", match.group(1)
202 206
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 parser.add_argument("mirror_name", nargs="?", help="Name of the mirror serve r that the file belongs to") 595 parser.add_argument("mirror_name", nargs="?", help="Name of the mirror serve r that the file belongs to")
592 parser.add_argument("server_type", nargs="?", help="Server type like downloa d, update or subscription") 596 parser.add_argument("server_type", nargs="?", help="Server type like downloa d, update or subscription")
593 parser.add_argument("log_file", nargs="?", help="Log file path, can be a loc al file path, http:// or ssh:// URL") 597 parser.add_argument("log_file", nargs="?", help="Log file path, can be a loc al file path, http:// or ssh:// URL")
594 args = parser.parse_args() 598 args = parser.parse_args()
595 599
596 if args.mirror_name and args.server_type and args.log_file: 600 if args.mirror_name and args.server_type and args.log_file:
597 sources = [(args.mirror_name, args.server_type, args.log_file)] 601 sources = [(args.mirror_name, args.server_type, args.log_file)]
598 else: 602 else:
599 sources = get_stats_files() 603 sources = get_stats_files()
600 parse_sources(sources, args.factor, args.verbose) 604 parse_sources(sources, args.factor, args.verbose)
OLDNEW
« no previous file with comments | « no previous file | sitescripts/stats/test/logprocessor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld