Skip to content
Snippets Groups Projects
Commit 9c7d2049 authored by Edward Betts's avatar Edward Betts
Browse files

New upstream version 0.8.0

parent e3a65e4c
Branches
Tags upstream/0.8.0
No related merge requests found
sudo: false
language: python
python:
- "3.5"
- "3.6"
env:
- TOX_ENV=py26
- TOX_ENV=py27
- TOX_ENV=py33
- TOX_ENV=py34
- TOX_ENV=py35
- TOX_ENV=pypy
- TOX_ENV=py36
- TOX_ENV=docs
- TOX_ENV=py27-flake8
- TOX_ENV=py35-flake8
- TOX_ENV=py36-flake8
install:
- pip install tox
......
......@@ -82,13 +82,14 @@ class build_regexes(Command):
with open(yaml_src, 'rb') as fp:
regexes = yaml.safe_load(fp)
with open(py_dest, 'wb') as fp:
fp.write(b'# -*- coding: utf-8 -*-\n')
fp.write(b'############################################\n')
fp.write(b'# NOTICE: This file is autogenerated from #\n')
fp.write(b'# regexes.yaml. Do not edit by hand, #\n')
fp.write(b'# instead, re-run `setup.py build_regexes` #\n')
fp.write(b'############################################\n')
fp.write(b'\n')
fp.write(b'from __future__ import absolute_import\n')
fp.write(b'from __future__ import absolute_import, unicode_literals\n')
fp.write(b'from .user_agent_parser import (\n')
fp.write(b' UserAgentParser, DeviceParser, OSParser,\n')
fp.write(b')\n')
......@@ -173,7 +174,7 @@ cmdclass = {
setup(
name='ua-parser',
version='0.7.3',
version='0.8.0',
description="Python port of Browserscope's user agent parser",
author='PBS',
author_email='no-reply@pbs.org',
......@@ -203,6 +204,7 @@ setup(
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
......
[tox]
envlist = py26, py27, pypy, py31, py32, py33, py34, py35, docs, py27-flake8, py35-flake8
envlist = py26, py27, py36, docs, py27-flake8, py36-flake8
[testenv]
deps =
......@@ -19,8 +19,8 @@ basepython = python2.7
deps = flake8
commands = flake8 {posargs}
[testenv:py35-flake8]
basepython = python3.5
[testenv:py36-flake8]
basepython = python3.6
deps = flake8
commands = flake8 {posargs}
......
VERSION = (0, 7, 3)
VERSION = (0, 8, 0)
......@@ -117,7 +117,10 @@ class OSParser(object):
os = match.group(1)
if self.os_v1_replacement:
os_v1 = self.os_v1_replacement
if re.search(r'\$1', self.os_v1_replacement):
os_v1 = re.sub(r'\$1', match.group(1), self.os_v1_replacement)
else:
os_v1 = self.os_v1_replacement
elif match.lastindex and match.lastindex >= 2:
os_v1 = match.group(2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment