tobie/ua-parser — pull request #160 by obeattie (2013-01-10 11:41:48+00:00)
Title: Fix installation on Ubuntu

On Ubuntu, `distutils` has been [patched](http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/python2.7/precise/view/head:/debian/patches/distutils-install-layout.diff) to, by default, use a different installation layout than is standard on Unix systems (to more closely follow FHS). As such, using `sys.prefix` to retrieve the location where data files are placed is not correct. This leads to installation failing as it can't access the regexes.yaml file.

To get around this, use the [`resource_filename`](http://peak.telecommunity.com/DevCenter/PythonEggs#accessing-package-resources) method provided by setuptools, which returns the correct location regardless of the platform.