diff --git a/xbob/db/replay/driver.py b/xbob/db/replay/driver.py index 9d6e9d6c5c8e1b1dce01a477c33ceef27645c2d0..d041f28b0f69b3d75bc7f68026f73a0cf1c9d32a 100644 --- a/xbob/db/replay/driver.py +++ b/xbob/db/replay/driver.py @@ -83,11 +83,11 @@ class Interface(BaseInterface): import pkg_resources # part of setuptools return pkg_resources.require('xbob.db.%s' % self.name())[0].version - def location(self): - return os.path.dirname(os.path.realpath(__file__)) - def files(self): - return ('db.sql3',) + + from pkg_resources import resource_filename + raw_files = ('db.sql3',) + return [resource_filename(__name__, k) for k in raw_files] def type(self): return 'sqlite' diff --git a/xbob/db/replay/query.py b/xbob/db/replay/query.py index ca7b122c802ddfdc39b4f22de54130ebeae5bfdd..3656d07fee9faddb9202e15db294f5becbf136cd 100644 --- a/xbob/db/replay/query.py +++ b/xbob/db/replay/query.py @@ -15,7 +15,7 @@ from .driver import Interface INFO = Interface() -SQLITE_FILE = os.path.join(INFO.location(), INFO.files()[0]) +SQLITE_FILE = INFO.files()[0] class Database(object): """The dataset class opens and maintains a connection opened to the Database. diff --git a/xbob/db/replay/test.py b/xbob/db/replay/test.py index 359e1b047a599b045078c8c7494774977865c9e7..d6e77cecb8c4b69ab3984d6efdf1cb634401785e 100644 --- a/xbob/db/replay/test.py +++ b/xbob/db/replay/test.py @@ -105,11 +105,11 @@ class ReplayDatabaseTest(unittest.TestCase): for k,v in f.items(): self.assertTrue(v.find('enroll') != -1) - def test09_manage_location(self): + def test09_manage_files(self): from bob.db.script.dbmanage import main - self.assertEqual(main('replay location'.split()), 0) + self.assertEqual(main('replay files'.split()), 0) def test10_manage_dumplist_1(self):