File tree Expand file tree Collapse file tree 3 files changed +56
-1
lines changed
Filter options
Expand file tree Collapse file tree 3 files changed +56
-1
lines changed
Original file line number Diff line number Diff line change
1
+ # file GENERATED by distutils, do NOT edit
2
+ LICENSE.txt
3
+ README.rst
4
+ setup.py
5
+ user_agents/__init__.py
6
+ user_agents/compat.py
7
+ user_agents/parsers.py
8
+ user_agents/tests.py
Original file line number Diff line number Diff line change 258
258
"is_touch_capable" : false ,
259
259
"ua_string" : " Mozilla/5.0 (iPhone; U; CPU iPhone OS) (compatible; Googlebot-Mobile/2.1; http://www.google.com/bot.html)" ,
260
260
"str" : " Spider / Other / Mobile Safari"
261
+ },
262
+ "windows_ce" : {
263
+ "is_bot" : false ,
264
+ "is_mobile" : true ,
265
+ "is_pc" : false ,
266
+ "is_tablet" : false ,
267
+ "is_touch_capable" : true ,
268
+ "ua_string" : " SAMSUNG-SGH-I617/UCHJ1 Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)" ,
269
+ "str" : " Samsung SGH-I617 / Windows CE / IE Mobile 7.11"
270
+ },
271
+ "windows_mobile" : {
272
+ "is_bot" : false ,
273
+ "is_mobile" : true ,
274
+ "is_pc" : false ,
275
+ "is_tablet" : false ,
276
+ "is_touch_capable" : true ,
277
+ "ua_string" : " Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 8.12; MSIEMobile 6.0) 320x240; VZW; UTStar-XV6175.1; Windows Mobile 6.5 Standard;" ,
278
+ "str" : " Other / Windows Mobile / IE Mobile 8.12"
279
+ },
280
+ "opera_mobile" : {
281
+ "is_bot" : false ,
282
+ "is_mobile" : true ,
283
+ "is_pc" : false ,
284
+ "is_tablet" : true ,
285
+ "is_touch_capable" : true ,
286
+ "ua_string" : " Opera/9.80 (Android 2.3.3; Linux; Opera Mobi/ADR-1202011015; U; en) Presto/2.9.201 Version/11.50" ,
287
+ "str" : " Opera / Android 2.3.3 / Opera Mobile 11.50"
288
+ },
289
+ "opera_mini" : {
290
+ "is_bot" : false ,
291
+ "is_mobile" : true ,
292
+ "is_pc" : false ,
293
+ "is_tablet" : false ,
294
+ "is_touch_capable" : false ,
295
+ "ua_string" : " Opera/9.80 (BREW; Opera Mini/5.0/27.2370; U; en) Presto/2.8.119 240X320 Samsung SCH-U380" ,
296
+ "str" : " Opera / Android 2.3.3 / Opera Mobile 11.50"
261
297
}
262
298
}
263
299
Original file line number Diff line number Diff line change 26
26
'Windows Phone OS' , # Earlier versions of ua-parser returns Windows Phone OS
27
27
'Symbian OS' ,
28
28
'Bada' ,
29
+ 'Windows CE' ,
30
+ 'Windows Mobile' ,
31
+ )
32
+
33
+ MOBILE_BROWSER_FAMILIES = (
34
+ 'Opera Mobile' ,
35
+ 'Opera Mini' ,
29
36
)
30
37
31
38
TABLET_DEVICE_FAMILIES = (
46
53
'Windows Phone' ,
47
54
'Windows Phone OS' ,
48
55
'Windows RT' ,
56
+ 'Windows CE' ,
57
+ 'Windows Mobile' ,
49
58
)
50
59
51
60
TOUCH_CAPABLE_DEVICE_FAMILIES = (
@@ -152,9 +161,11 @@ def is_tablet(self):
152
161
153
162
@property
154
163
def is_mobile (self ):
155
- # First check for mobile device families
164
+ # First check for mobile device and mobile browser families
156
165
if self .device .family in MOBILE_DEVICE_FAMILIES :
157
166
return True
167
+ if self .browser .family in MOBILE_BROWSER_FAMILIES :
168
+ return True
158
169
# Device is considered Mobile OS is Android and not tablet
159
170
# This is not fool proof but would have to suffice for now
160
171
if self .os .family == 'Android' and not self .is_tablet :
You can’t perform that action at this time.
0 commit comments