From 12aebb7eee4f31d9ae3719217c2eb07368bfdd66 Mon Sep 17 00:00:00 2001 From: Rafa de la Torre Date: Mon, 3 Oct 2016 17:35:33 +0200 Subject: [PATCH] Rename ConfigStorageInterface to ConfigBackendInterface --- .../cartodb_services/refactor/backend/org_config.py | 2 +- .../cartodb_services/refactor/backend/user_config.py | 2 +- .../cartodb_services/refactor/{storage => core}/interfaces.py | 4 ++-- .../cartodb_services/refactor/storage/mem_config.py | 4 ++-- .../cartodb_services/refactor/storage/null_config.py | 4 ++-- .../cartodb_services/refactor/storage/redis_config.py | 4 ++-- .../cartodb_services/refactor/storage/server_config.py | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) rename server/lib/python/cartodb_services/cartodb_services/refactor/{storage => core}/interfaces.py (64%) diff --git a/server/lib/python/cartodb_services/cartodb_services/refactor/backend/org_config.py b/server/lib/python/cartodb_services/cartodb_services/refactor/backend/org_config.py index d712c7b..0635585 100644 --- a/server/lib/python/cartodb_services/cartodb_services/refactor/backend/org_config.py +++ b/server/lib/python/cartodb_services/cartodb_services/refactor/backend/org_config.py @@ -5,7 +5,7 @@ from cartodb_services.refactor.storage.redis_config import RedisOrgConfigStorage class OrgConfigBackendFactory(object): """ This class abstracts the creation of an org configuration storage. It will return - an implementation of the ConfigStorageInterface appropriate to the org, depending + an implementation of the ConfigBackendInterface appropriate to the org, depending on the environment. """ diff --git a/server/lib/python/cartodb_services/cartodb_services/refactor/backend/user_config.py b/server/lib/python/cartodb_services/cartodb_services/refactor/backend/user_config.py index 438cb6c..5bb2f6b 100644 --- a/server/lib/python/cartodb_services/cartodb_services/refactor/backend/user_config.py +++ b/server/lib/python/cartodb_services/cartodb_services/refactor/backend/user_config.py @@ -5,7 +5,7 @@ from cartodb_services.refactor.storage.redis_config import RedisUserConfigStorag class UserConfigBackendFactory(object): """ This class abstracts the creation of a user configuration storage. It will return - an implementation of the ConfigStorageInterface appropriate to the user, depending + an implementation of the ConfigBackendInterface appropriate to the user, depending on the environment. """ diff --git a/server/lib/python/cartodb_services/cartodb_services/refactor/storage/interfaces.py b/server/lib/python/cartodb_services/cartodb_services/refactor/core/interfaces.py similarity index 64% rename from server/lib/python/cartodb_services/cartodb_services/refactor/storage/interfaces.py rename to server/lib/python/cartodb_services/cartodb_services/refactor/core/interfaces.py index 5f00f53..46dcd42 100644 --- a/server/lib/python/cartodb_services/cartodb_services/refactor/storage/interfaces.py +++ b/server/lib/python/cartodb_services/cartodb_services/refactor/core/interfaces.py @@ -1,7 +1,7 @@ import abc -class ConfigStorageInterface(object): - """This is an interface that all config storages must abide to""" +class ConfigBackendInterface(object): + """This is an interface that all config backends must abide to""" __metaclass__ = abc.ABCMeta diff --git a/server/lib/python/cartodb_services/cartodb_services/refactor/storage/mem_config.py b/server/lib/python/cartodb_services/cartodb_services/refactor/storage/mem_config.py index 01d3981..0661626 100644 --- a/server/lib/python/cartodb_services/cartodb_services/refactor/storage/mem_config.py +++ b/server/lib/python/cartodb_services/cartodb_services/refactor/storage/mem_config.py @@ -1,6 +1,6 @@ -from interfaces import ConfigStorageInterface +from ..core.interfaces import ConfigBackendInterface -class InMemoryConfigStorage(ConfigStorageInterface): +class InMemoryConfigStorage(ConfigBackendInterface): def __init__(self, config_hash={}): self._config_hash = config_hash diff --git a/server/lib/python/cartodb_services/cartodb_services/refactor/storage/null_config.py b/server/lib/python/cartodb_services/cartodb_services/refactor/storage/null_config.py index 88e0cad..b9c11e6 100644 --- a/server/lib/python/cartodb_services/cartodb_services/refactor/storage/null_config.py +++ b/server/lib/python/cartodb_services/cartodb_services/refactor/storage/null_config.py @@ -1,6 +1,6 @@ -from interfaces import ConfigStorageInterface +from ..core.interfaces import ConfigBackendInterface -class NullConfigStorage(ConfigStorageInterface): +class NullConfigStorage(ConfigBackendInterface): def get(self, key): return None diff --git a/server/lib/python/cartodb_services/cartodb_services/refactor/storage/redis_config.py b/server/lib/python/cartodb_services/cartodb_services/refactor/storage/redis_config.py index f01d492..cdb2e57 100644 --- a/server/lib/python/cartodb_services/cartodb_services/refactor/storage/redis_config.py +++ b/server/lib/python/cartodb_services/cartodb_services/refactor/storage/redis_config.py @@ -1,8 +1,8 @@ -from interfaces import ConfigStorageInterface +from ..core.interfaces import ConfigBackendInterface from null_config import NullConfigStorage -class RedisConfigStorage(ConfigStorageInterface): +class RedisConfigStorage(ConfigBackendInterface): def __init__(self, connection, config_key): self._connection = connection diff --git a/server/lib/python/cartodb_services/cartodb_services/refactor/storage/server_config.py b/server/lib/python/cartodb_services/cartodb_services/refactor/storage/server_config.py index 0597d2b..50137ca 100644 --- a/server/lib/python/cartodb_services/cartodb_services/refactor/storage/server_config.py +++ b/server/lib/python/cartodb_services/cartodb_services/refactor/storage/server_config.py @@ -1,8 +1,8 @@ import json import cartodb_services -from interfaces import ConfigStorageInterface +from ..core.interfaces import ConfigBackendInterface -class InDbServerConfigStorage(ConfigStorageInterface): +class InDbServerConfigStorage(ConfigBackendInterface): def get(self, key): sql = "SELECT cdb_dataservices_server.cdb_conf_getconf('{0}') as conf".format(key)