Move setting up of storage into init/__init__.py

Factoring out this one should be the last one needed to
rewrite the celery setup. The idea is to not setup the
whole app, but just call a bunch of individual setup_*
functions and be done.
This commit is contained in:
Elrond
2011-07-17 16:09:22 +02:00
parent e60f8719dd
commit dccef26263
2 changed files with 19 additions and 10 deletions

View File

@@ -23,6 +23,7 @@ from mediagoblin.mg_globals import setup_globals
from mediagoblin.db.open import setup_connection_and_db_from_config
from mediagoblin.db.util import MigrationManager
from mediagoblin.workbench import WorkbenchManager
from mediagoblin.storage import storage_system_from_config
class Error(Exception): pass
@@ -103,6 +104,19 @@ def get_staticdirector(app_config):
"direct_remote_paths must be provided")
def setup_storage():
app_config = mg_globals.app_config
public_store = storage_system_from_config(app_config, 'publicstore')
queue_store = storage_system_from_config(app_config, 'queuestore')
setup_globals(
public_store = public_store,
queue_store = queue_store)
return public_store, queue_store
def setup_workbench():
app_config = mg_globals.app_config