Commit ab6234d3 authored by Philip ABBET's avatar Philip ABBET

Add missing usages of the 'Prefix' class

parent 68fe111b
......@@ -63,9 +63,13 @@ class Storage(utils.CodeStorage):
raise RuntimeError("invalid algorithm name: `%s'" % name)
self.username, self.name, self.version = name.split('/')
self.prefix = prefix
self.fullname = name
if isinstance(prefix, utils.Prefix):
self.prefix = prefix
else:
self.prefix = utils.Prefix(prefix)
path = utils.hashed_or_simple(self.prefix, 'algorithms', name + '.json')
path = path[:-5]
super(Storage, self).__init__(path, language)
......
......@@ -68,7 +68,12 @@ class Storage(utils.CodeStorage):
self.name, self.version = name.split('/')
self.fullname = name
path = prefix.path(os.path.join('databases', name + '.json'))
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 = path[:-5]
super(Storage, self).__init__(path, 'python') #views are coded in Python
......
......@@ -64,7 +64,12 @@ class Storage(utils.Storage):
self.username, self.name, self.version = name.split('/')
self.fullname = name
path = utils.hashed_or_simple(prefix, 'dataformats', name + '.json')
if isinstance(prefix, utils.Prefix):
self.prefix = prefix
else:
self.prefix = utils.Prefix(prefix)
path = utils.hashed_or_simple(self.prefix, 'dataformats', name + '.json')
path = path[:-5]
super(Storage, self).__init__(path)
......
......@@ -29,7 +29,7 @@
"""Validation for libraries"""
import os
import six
import simplejson
from . import loader
......@@ -58,9 +58,13 @@ class Storage(utils.CodeStorage):
raise RuntimeError("invalid library name: `%s'" % name)
self.username, self.name, self.version = name.split('/')
self.prefix = prefix
self.fullname = name
if isinstance(prefix, utils.Prefix):
self.prefix = prefix
else:
self.prefix = utils.Prefix(prefix)
path = utils.hashed_or_simple(self.prefix, 'libraries', name + '.json')
path = path[:-5]
super(Storage, self).__init__(path, language)
......
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