From 104010ae199824a78546bd232fc3edefeea7debb Mon Sep 17 00:00:00 2001
From: Tiago Freitas Pereira <tiagofrepereira@gmail.com>
Date: Sat, 10 Sep 2016 11:09:38 +0200
Subject: [PATCH] [refactoring2016] Moved bob.bio.db.BioDatabase to
 bob.bio.base

---
 bob/bio/base/preprocessor/Preprocessor.py | 7 +------
 bob/bio/base/script/preprocess.py         | 4 ++--
 bob/bio/base/test/dummy/database.py       | 2 +-
 bob/bio/base/test/test_preprocessor.py    | 5 +----
 4 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/bob/bio/base/preprocessor/Preprocessor.py b/bob/bio/base/preprocessor/Preprocessor.py
index 6ac4e9fc..ba9e4fcd 100644
--- a/bob/bio/base/preprocessor/Preprocessor.py
+++ b/bob/bio/base/preprocessor/Preprocessor.py
@@ -3,11 +3,6 @@
 # @author: Manuel Guenther <Manuel.Guenther@idiap.ch>
 # @date: Tue Oct  2 12:12:39 CEST 2012
 
-import bob.io.base
-import bob.bio.db
-
-import os
-
 from .. import utils
 
 class Preprocessor:
@@ -21,7 +16,7 @@ class Preprocessor:
 
   read_original_data: callable
     This function is used to read the original data from file.
-    It takes three inputs: A :py:class:`bob.bio.db.BioFile` (or one of its derivatives), the original directory (as ``str``) and the original extension (as ``str``).
+    It takes three inputs: A :py:class:`bob.bio.base.database.BioFile` (or one of its derivatives), the original directory (as ``str``) and the original extension (as ``str``).
 
   kwargs : ``key=value`` pairs
     A list of keyword arguments to be written in the :py:meth:`__str__` function.
diff --git a/bob/bio/base/script/preprocess.py b/bob/bio/base/script/preprocess.py
index db58f297..ccc83704 100644
--- a/bob/bio/base/script/preprocess.py
+++ b/bob/bio/base/script/preprocess.py
@@ -6,7 +6,7 @@ import bob.core
 logger = bob.core.log.setup("bob.bio.base")
 
 import bob.bio.base
-import bob.bio.db
+from bob.bio.base.database.file import BioFile
 import bob.db.base
 import numpy
 
@@ -47,7 +47,7 @@ def main(command_line_parameters=None):
   preprocessor = bob.bio.base.load_resource(' '.join(args.preprocessor), "preprocessor")
 
   logger.debug("Loading input data from file '%s'%s", args.input_file, " and '%s'" % args.annotation_file if args.annotation_file is not None else "")
-  data = preprocessor.read_original_data(bob.bio.db.BioFile(1, args.input_file, 2), "", "")
+  data = preprocessor.read_original_data(BioFile(1, args.input_file, 2), "", "")
   annotations = bob.db.base.annotations.read_annotation_file(args.annotation_file, 'named') if args.annotation_file is not None else None
 
   logger.info("Preprocessing data")
diff --git a/bob/bio/base/test/dummy/database.py b/bob/bio/base/test/dummy/database.py
index 94852fc1..e8cfac92 100644
--- a/bob/bio/base/test/dummy/database.py
+++ b/bob/bio/base/test/dummy/database.py
@@ -1,5 +1,5 @@
 from bob.bio.base.database import ZTBioDatabase
-from bob.bio.base.file import BioFile
+from bob.bio.base.database.file import BioFile
 from bob.bio.base.test.utils import atnt_database_directory
 
 
diff --git a/bob/bio/base/test/test_preprocessor.py b/bob/bio/base/test/test_preprocessor.py
index 577f73ad..e822c1e5 100644
--- a/bob/bio/base/test/test_preprocessor.py
+++ b/bob/bio/base/test/test_preprocessor.py
@@ -1,7 +1,4 @@
 import bob.bio.base
-import bob.bio.db
-
-from . import utils
 
 def test_filename():
   # load extractor
@@ -10,7 +7,7 @@ def test_filename():
   assert isinstance(preprocessor, bob.bio.base.preprocessor.Filename)
 
   # try to load the original image
-  assert preprocessor.read_original_data(bob.bio.db.BioFile(1,"2",3), "/any/path", ".any.extension") is None
+  assert preprocessor.read_original_data(bob.bio.base.database.file.BioFile(1,"2",3), "/any/path", ".any.extension") is None
 
   # try to process
   assert preprocessor(None, None) == 1
-- 
GitLab