diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-07-17 16:09:22 +0200 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-07-18 14:20:58 +0200 |
commit | dccef26263ba98c47fc5f8121a074a34b012ba89 (patch) | |
tree | cb59b0d45ecd62c9646ff33658527311f6211534 /mediagoblin/init | |
parent | e60f8719dd8ffbafe4a3e2313f32e7f867227577 (diff) | |
download | mediagoblin-dccef26263ba98c47fc5f8121a074a34b012ba89.tar.lz mediagoblin-dccef26263ba98c47fc5f8121a074a34b012ba89.tar.xz mediagoblin-dccef26263ba98c47fc5f8121a074a34b012ba89.zip |
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.
Diffstat (limited to 'mediagoblin/init')
-rw-r--r-- | mediagoblin/init/__init__.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mediagoblin/init/__init__.py b/mediagoblin/init/__init__.py index 1e519cc9..64fa9b92 100644 --- a/mediagoblin/init/__init__.py +++ b/mediagoblin/init/__init__.py @@ -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 |