Commit 751836f6 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

[refactoring_2016] Redefinition of the low level API

parent 9bdefed0
Pipeline #3248 passed with stages
in 13 minutes and 45 seconds
...@@ -26,7 +26,7 @@ from bob.db.base.sqlalchemy_migration import Enum, relationship ...@@ -26,7 +26,7 @@ from bob.db.base.sqlalchemy_migration import Enum, relationship
from sqlalchemy.orm import backref from sqlalchemy.orm import backref
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.declarative import declarative_base
import bob.db.verification.utils import bob.db.base
Base = declarative_base() Base = declarative_base()
...@@ -54,7 +54,7 @@ class Client(Base): ...@@ -54,7 +54,7 @@ class Client(Base):
__tablename__ = 'client' __tablename__ = 'client'
class File(Base, bob.db.verification.utils.File): class File(Base, bob.db.base.File):
"""Generic file container""" """Generic file container"""
__tablename__ = 'file' __tablename__ = 'file'
...@@ -79,7 +79,7 @@ class File(Base, bob.db.verification.utils.File): ...@@ -79,7 +79,7 @@ class File(Base, bob.db.verification.utils.File):
def __init__(self, client_id, path, session_id, camera, shot_id): def __init__(self, client_id, path, session_id, camera, shot_id):
# call base class constructor # call base class constructor
bob.db.verification.utils.File.__init__(self, client_id = client_id, path = path) bob.db.base.File.__init__(self, client_id = client_id, path = path)
self.session_id = session_id self.session_id = session_id
self.camera = camera self.camera = camera
......
...@@ -24,11 +24,11 @@ import os ...@@ -24,11 +24,11 @@ import os
from .models import * from .models import *
from .driver import Interface from .driver import Interface
import bob.db.verification.utils import bob.db.base
SQLITE_FILE = Interface().files()[0] SQLITE_FILE = Interface().files()[0]
class Database(bob.db.verification.utils.SQLiteDatabase): class Database(bob.db.base.SQLiteDatabase):
"""The dataset class opens and maintains a connection opened to the Database. """The dataset class opens and maintains a connection opened to the Database.
It provides many different ways to probe for the characteristics of the data It provides many different ways to probe for the characteristics of the data
...@@ -37,7 +37,9 @@ class Database(bob.db.verification.utils.SQLiteDatabase): ...@@ -37,7 +37,9 @@ class Database(bob.db.verification.utils.SQLiteDatabase):
def __init__(self, original_directory = None, original_extension = '.jpg'): def __init__(self, original_directory = None, original_extension = '.jpg'):
# call base class constructors # call base class constructors
bob.db.verification.utils.SQLiteDatabase.__init__(self, SQLITE_FILE, File, original_directory = original_directory, original_extension = original_extension) super(Database, self).__init__(SQLITE_FILE, File)
self.original_directory = original_directory
self.original_extension = original_extension
def groups(self, protocol=None): def groups(self, protocol=None):
"""Returns the names of all registered groups""" """Returns the names of all registered groups"""
......
...@@ -13,7 +13,6 @@ develop = src/bob.extension ...@@ -13,7 +13,6 @@ develop = src/bob.extension
src/bob.core src/bob.core
src/bob.io.base src/bob.io.base
src/bob.db.base src/bob.db.base
src/bob.db.verification.utils
. .
; options for bob.buildout extension ; options for bob.buildout extension
...@@ -27,7 +26,6 @@ bob.blitz = git https://gitlab.idiap.ch/bob/bob.blitz ...@@ -27,7 +26,6 @@ bob.blitz = git https://gitlab.idiap.ch/bob/bob.blitz
bob.core = git https://gitlab.idiap.ch/bob/bob.core bob.core = git https://gitlab.idiap.ch/bob/bob.core
bob.io.base = git https://gitlab.idiap.ch/bob/bob.io.base bob.io.base = git https://gitlab.idiap.ch/bob/bob.io.base
bob.db.base = git https://gitlab.idiap.ch/bob/bob.db.base bob.db.base = git https://gitlab.idiap.ch/bob/bob.db.base
bob.db.verification.utils = git https://gitlab.idiap.ch/bob/bob.db.verification.utils
[scripts] [scripts]
recipe = bob.buildout:scripts recipe = bob.buildout:scripts
......
...@@ -16,7 +16,7 @@ This package only contains the Bob_ accessor methods to use the DB directly from ...@@ -16,7 +16,7 @@ This package only contains the Bob_ accessor methods to use the DB directly from
The Database Interface The Database Interface
---------------------- ----------------------
The :py:class:`bob.db.biosecure.Database` complies with the standard biometric verification database as described in :ref:`commons`, implementing the interface :py:class:`bob.db.verification.utils.SQLiteDatabase`. The :py:class:`bob.db.biosecure.Database` complies with the standard biometric verification database as described in :ref:`commons`, implementing the interface :py:class:`bob.db.base.SQLiteDatabase`.
.. todo:: .. todo::
Explain the particularities of the :py:class:`bob.db.biosecure.Database` database. Explain the particularities of the :py:class:`bob.db.biosecure.Database` database.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment