From a6a499b4c4d0db56beab6b99468ebf445a9503ec Mon Sep 17 00:00:00 2001
From: Samuel Gaist <samuel.gaist@idiap.ch>
Date: Thu, 1 Mar 2018 16:41:58 +0100
Subject: [PATCH] [dataformat] Remove use of Prefix

---
 beat/backend/python/dataformat.py | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/beat/backend/python/dataformat.py b/beat/backend/python/dataformat.py
index 2bf315c..d4d9ae8 100755
--- a/beat/backend/python/dataformat.py
+++ b/beat/backend/python/dataformat.py
@@ -48,8 +48,7 @@ class Storage(utils.Storage):
 
     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 dataformat object in the format
         ``<user>/<name>/<version>``.
@@ -63,11 +62,7 @@ class Storage(utils.Storage):
 
         self.username, self.name, self.version = name.split('/')
         self.fullname = name
-
-        if isinstance(prefix, utils.Prefix):
-            self.prefix = prefix
-        else:
-            self.prefix = utils.Prefix(prefix)
+        self.prefix = prefix
 
         path = utils.hashed_or_simple(self.prefix, 'dataformats', name, suffix='.json')
         path = path[:-5]
@@ -87,7 +82,7 @@ class DataFormat(object):
 
     Parameters:
 
-      prefix (beat.backend.python.utils.Prefix): Establishes the prefix of
+      prefix (str): Establishes the prefix of
         your installation.
 
       data (str, dict): The fully qualified algorithm name (e.g. ``user/algo/1``)
@@ -492,8 +487,7 @@ class DataFormat(object):
 
         Parameters:
 
-          prefix (beat.backend.python.utils.Prefix): Establishes the prefix of
-            your installation.
+          prefix (str): Establishes the prefix of your installation.
 
 
         Returns:
@@ -513,9 +507,6 @@ class DataFormat(object):
         if not self.valid:
             raise RuntimeError("dataformat is not valid")
 
-        if isinstance(prefix, six.string_types):
-            prefix = utils.Prefix(prefix)
-
         if prefix == self.prefix:
             raise RuntimeError("Cannot export dataformat to the same prefix ("
                                "%s)" % prefix)
-- 
GitLab