Permalink
Browse files

parse the Python Requests library user agent

  • Loading branch information...
1 parent 3dab0b5 commit a6d1f33f3e4567f3d75c8fa7b0be1fd453da0dba Jason Carver committed Nov 11, 2012
Showing with 18 additions and 1 deletion.
  1. +4 −0 regexes.yaml
  2. +6 −0 test_resources/test_user_agent_parser.yaml
  3. +8 −1 test_resources/test_user_agent_parser_os.yaml
View
@@ -327,6 +327,9 @@ user_agent_parsers:
family_replacement: 'IE'
- regex: '(Nintendo 3DS).* Version/(\d+)\.(\d+)(?:\.(\w+))'
+
+ - regex: '(python-requests)/(\d+)\.(\d+)'
+ family_replacement: 'Python Requests'
os_parsers:
@@ -516,6 +519,7 @@ os_parsers:
# just os
- regex: '(Windows|OpenBSD|FreeBSD|NetBSD|Ubuntu|Kubuntu|Android|Arch Linux|CentOS|WeTab|Slackware)'
+ - regex: '(Linux)/(\d+)\.(\d+)'
- regex: '(Linux|BSD)'
device_parsers:
@@ -369,3 +369,9 @@ test_cases:
major: '0'
minor: '6'
patch: '1'
+
+ - user_agent_string: 'python-requests/0.14 CPython/2.6 Linux/2.6-43-server'
+ family: 'Python Requests'
+ major: '0'
+ minor: '14'
+ patch:
@@ -343,4 +343,11 @@ test_cases:
major:
minor:
patch:
- patch_minor:
+ patch_minor:
+
+ - user_agent_string: 'python-requests/0.14 CPython/2.6 Linux/2.6-43-server'
+ family: 'Linux'
+ major: '2'
+ minor: '6'
+ patch:
+ patch_minor:

0 comments on commit a6d1f33

Please sign in to comment.