From 73edfba8de3b47749bf29bc714982824eee98eb3 Mon Sep 17 00:00:00 2001
From: Samuel Gaist <samuel.gaist@idiap.ch>
Date: Thu, 1 Mar 2018 16:42:07 +0100
Subject: [PATCH] [database] Remove use of Prefix

---
 beat/backend/python/database.py | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/beat/backend/python/database.py b/beat/backend/python/database.py
index c1fdac4..139fef8 100755
--- a/beat/backend/python/database.py
+++ b/beat/backend/python/database.py
@@ -52,8 +52,7 @@ class Storage(utils.CodeStorage):
 
     Parameters:
 
-      prefix (beat.backend.python.utils.Prefix): Establishes the prefix of
-        your installation.
+      prefix (str): Establishes the prefix of your installation.
 
       name (str): The name of the database object in the format
         ``<name>/<version>``.
@@ -67,13 +66,9 @@ class Storage(utils.CodeStorage):
 
         self.name, self.version = name.split('/')
         self.fullname = name
+        self.prefix = prefix
 
-        if isinstance(prefix, utils.Prefix):
-            self.prefix = prefix
-        else:
-            self.prefix = utils.Prefix(prefix)
-
-        path = self.prefix.path(os.path.join('databases', name + '.json'))
+        path = os.path.join(self.prefix, 'databases', name + '.json')
         path = path[:-5]
         super(Storage, self).__init__(path, 'python') #views are coded in Python
 
@@ -91,8 +86,7 @@ class Runner(object):
       module (module): The preloaded module containing the database views as
         returned by :py:func:`beat.core.loader.load_module`.
 
-      prefix (beat.backend.python.utils.Prefix): Establishes the prefix of
-        your installation.
+      prefix (str): Establishes the prefix of your installation.
 
       root_folder (str, path): The path pointing to the root folder of this
         database
@@ -198,8 +192,7 @@ class Database(object):
 
     Parameters:
 
-      prefix (beat.backend.python.utils.Prefix): Establishes the prefix of
-        your installation.
+      prefix (str): Establishes the prefix of your installation.
 
       name (str): The fully qualified database name (e.g. ``db/1``)
 
-- 
GitLab