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

Unified Diff: sitescripts/stats/bin/logprocessor.py

Issue 6205888910065664: Recognize Firefox Tablet correctly (Closed)
Patch Set: Fixed typo Created Jan. 13, 2014, 6:55 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sitescripts/stats/test/logprocessor.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/stats/bin/logprocessor.py
===================================================================
--- a/sitescripts/stats/bin/logprocessor.py
+++ b/sitescripts/stats/bin/logprocessor.py
@@ -144,16 +144,18 @@ def parse_ua(ua):
return "Firefox Mobile", match.group(2)
else:
return match.group(1), match.group(2)
match = re.search(r"\bFirefox/(\d+\.\d+)", ua)
if match:
if re.search(r"\bMobile;", ua):
return "Firefox Mobile", match.group(1)
+ elif re.search(r"\bTablet;", ua):
+ return "Firefox Tablet", match.group(1)
else:
return "Firefox", match.group(1)
match = re.search(r"\brv:(\d+)\.(\d+)(?:\.(\d+))?", ua)
if match and re.search(r"\bGecko/", ua):
if match.group(3) and int(match.group(1)) < 2:
return "Gecko", "%s.%s.%s" % (match.group(1), match.group(2), match.group(3))
else:
« 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