Open miketaylr opened 10 years ago
I'm happy to provide a patch. Not today. but next week.
@karlcow thanks for the offer :). Let's hope that https://github.com/tobie/ua-parser/pull/331 gets merged soon.
Oh. Indeed you have a dependency on @tobie library. Understood aand @miketaylr already did a patch there.
from ua_parser import user_agent_parser
This can be closed as FIXED.
>>> # Accessing user agent's browser attributes
... user_agent.browser
Browser(family='Firefox Mobile', version=(44,), version_string='44')
>>> user_agent.browser.family
'Firefox Mobile'
>>> user_agent.browser.version
(44,)
>>> user_agent.browser.version_string
'44'
>>>
>>> # Accessing user agent's operating system properties
... user_agent.os
OperatingSystem(family='Firefox OS', version=(), version_string='')
>>> user_agent.os.family
'Firefox OS'
>>> user_agent.os.version
()
>>> user_agent.os.version_string
''
>>>
>>> # Accessing user agent's device properties
... user_agent.device
Device(family='Generic Smartphone', brand='Generic', model='Smartphone')
>>> user_agent.device.family
'Generic Smartphone'
>>> user_agent.device.brand
'Generic'
>>> user_agent.device.model
'Smartphone'
>>>
>>> # Viewing a pretty string version
... str(user_agent)
'Generic Smartphone / Firefox OS / Firefox Mobile 44'
>>> user_agent.is_touch_capable
False
>>> user_agent.is_tablet
False
>>> user_agent.is_mobile
True
>>>
maybe apart the is_touch_capable
Just an old version.
>>> import user_agents
>>> user_agents.VERSION
(0, 3, 2)
Let's close it as Fixed.
Hi there. There's currently some problems with parsing Firefox OS ua strings:
Firefox OS Mobile:
is_mobile
andis_touch_capable
should be true.Firefox OS for tablets:
is_mobile
andis_touch_capable
should be true.os.family
should report Firefox OS -- I've made a pull request against ua-parser for that though: https://github.com/tobie/ua-parser/pull/331