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/app.py | |
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/app.py')
-rw-r--r-- | mediagoblin/app.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/mediagoblin/app.py b/mediagoblin/app.py index 85c3c0c7..58db4e8d 100644 --- a/mediagoblin/app.py +++ b/mediagoblin/app.py @@ -20,11 +20,12 @@ import urllib import routes from webob import Request, exc -from mediagoblin import routing, util, storage +from mediagoblin import routing, util from mediagoblin.mg_globals import setup_globals from mediagoblin.init.celery import setup_celery_from_config from mediagoblin.init import get_jinja_loader, get_staticdirector, \ - setup_global_and_app_config, setup_workbench, setup_database + setup_global_and_app_config, setup_workbench, setup_database, \ + setup_storage class MediaGoblinApp(object): @@ -62,10 +63,7 @@ class MediaGoblinApp(object): app_config.get('user_template_path')) # Set up storage systems - self.public_store = storage.storage_system_from_config( - app_config, 'publicstore') - self.queue_store = storage.storage_system_from_config( - app_config, 'queuestore') + self.public_store, self.queue_store = setup_storage() # set up routing self.routing = routing.get_mapper() @@ -90,10 +88,7 @@ class MediaGoblinApp(object): # object. ####################################################### - setup_globals( - app=self, - public_store=self.public_store, - queue_store=self.queue_store) + setup_globals(app = self) # Workbench *currently* only used by celery, so this only # matters in always eager mode :) |