Skip to content

Commit

Permalink
Python3 port for device-detector (#5741)
Browse files Browse the repository at this point in the history
* Add python port to "other languages" list

* Tweak regexes and fixtures for compability with Python port

I believe these should still work correctly on regex
engines in the other languages represented.
  • Loading branch information
thinkwelltwd authored and sgiehl committed May 26, 2018
1 parent c00b2ea commit 746721a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -167,6 +167,7 @@ There are already a few ports of this tool to other languages:
- **.NET** https://github.com/totpero/DeviceDetector.NET
- **Ruby** https://github.com/podigee/device_detector
- **Node.JS** https://github.com/sanchezzzhak/node-device-detector
- **Python 3** https://github.com/thinkwelltwd/device_detector


## What Device Detector is able to detect
Expand Down
2 changes: 1 addition & 1 deletion Tests/fixtures/smartphone-5.yml
Expand Up @@ -720,7 +720,7 @@
device:
type: smartphone
brand: TB
model: null
model: "D5"
os_family: Android
browser_family: Android Browser
-
Expand Down
4 changes: 2 additions & 2 deletions Tests/fixtures/smartphone.yml
Expand Up @@ -75,8 +75,8 @@
engine_version: ""
device:
type: smartphone
brand: ""
model: ""
brand: "LY"
model: "Wind 2"
os_family: Android
browser_family: Chrome
-
Expand Down
6 changes: 3 additions & 3 deletions regexes/device/mobiles.yml
Expand Up @@ -1037,7 +1037,7 @@ Blackview:

# Boway
Boway:
regex: 'BOWAY'
regex: '(?:sprd-)?(BOWAY)'
device: 'smartphone'
models:
- regex: 'BOWAY[ _-]([^/;]+)[ _]Build'
Expand Down Expand Up @@ -2751,7 +2751,7 @@ IconBIT:

# LYF
LYF:
regex: '(LYF[ _])?LS-[45][0-9]{3}'
regex: '(LYF[ _])?LS-[456][0-9]{3}'
device: 'smartphone'
models:
- regex: 'LS-4004'
Expand Down Expand Up @@ -5704,7 +5704,7 @@ Tecno Mobile:
models:
- regex: 'Tecno ([^;/]+) Build'
model: '$1'
- regex: 'Tecno_?([a-z0-9_\-]+)'
- regex: 'Tecno[ _]?([a-z0-9_\-]+)'
model: '$1'

# Tesco
Expand Down

0 comments on commit 746721a

Please sign in to comment.