Skip to content

Commit

Permalink
Rename result_backends to backends
Browse files Browse the repository at this point in the history
For #42
* Import all backends into backends __init__ to allow simpler imports
  • Loading branch information
emmanuel valette committed Jan 2, 2017
1 parent bff1a08 commit e4c2371
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 5 deletions.
12 changes: 12 additions & 0 deletions oct/backends/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from oct.backends.redis import RedisStore, RedisLoader
from oct.backends.dummy import DummyStore, DummyLoader
from oct.backends.sqlite import SQLiteStore, SQLiteLoader

__all__ = [
'RedisStore',
'RedisLoader',
'DummyStore',
'DummyLoader',
'SQLiteStore',
'SQLiteLoader'
]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file removed oct/result_backends/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions oct/utilities/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def get_loader_class(config):
:param dict config: project configuration dict
"""
loader_str = config.get('results_backend', {})\
.get('loader', 'oct.result_backends.sqlite.SQLiteLoader')
.get('loader', 'oct.backends.SQLiteLoader')

as_list = loader_str.split('.')
module = importlib.import_module(".".join(as_list[:-1]))
Expand All @@ -117,7 +117,7 @@ def get_store_class(config):
:param dict config: project configuration dict
"""
store_str = config.get('results_backend', {})\
.get('store', 'oct.result_backends.sqlite.SQLiteStore')
.get('store', 'oct.backends.SQLiteStore')

as_list = store_str.split('.')
module = importlib.import_module(".".join(as_list[:-1]))
Expand Down
4 changes: 2 additions & 2 deletions oct/utilities/templates/configuration/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ results_database:
params: null
insert_limit: 150
results_backend:
store: "oct.result_backends.sqlite.SQLiteStore"
loader: "oct.result_backends.sqlite.SQLiteStore"
store: "oct.backends.SQLiteStore"
loader: "oct.backends.SQLiteLoader"
backend_params:
db: 0
host: 'localhost'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'oct.utilities',
'oct.tools',
'oct.results',
'oct.result_backends'
'oct.backends'
],
package_data={
'oct.utilities': [
Expand Down

0 comments on commit e4c2371

Please sign in to comment.