Merge remote branch 'remotes/elrond/dev/init'
This commit is contained in:
commit
f36d426134
@ -20,11 +20,12 @@ import urllib
|
|||||||
import routes
|
import routes
|
||||||
from webob import Request, exc
|
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.mg_globals import setup_globals
|
||||||
from mediagoblin.init.celery import setup_celery_from_config
|
from mediagoblin.init.celery import setup_celery_from_config
|
||||||
from mediagoblin.init import get_jinja_loader, get_staticdirector, \
|
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):
|
class MediaGoblinApp(object):
|
||||||
@ -62,10 +63,7 @@ class MediaGoblinApp(object):
|
|||||||
app_config.get('user_template_path'))
|
app_config.get('user_template_path'))
|
||||||
|
|
||||||
# Set up storage systems
|
# Set up storage systems
|
||||||
self.public_store = storage.storage_system_from_config(
|
self.public_store, self.queue_store = setup_storage()
|
||||||
app_config, 'publicstore')
|
|
||||||
self.queue_store = storage.storage_system_from_config(
|
|
||||||
app_config, 'queuestore')
|
|
||||||
|
|
||||||
# set up routing
|
# set up routing
|
||||||
self.routing = routing.get_mapper()
|
self.routing = routing.get_mapper()
|
||||||
@ -90,10 +88,7 @@ class MediaGoblinApp(object):
|
|||||||
# object.
|
# object.
|
||||||
#######################################################
|
#######################################################
|
||||||
|
|
||||||
setup_globals(
|
setup_globals(app = self)
|
||||||
app=self,
|
|
||||||
public_store=self.public_store,
|
|
||||||
queue_store=self.queue_store)
|
|
||||||
|
|
||||||
# Workbench *currently* only used by celery, so this only
|
# Workbench *currently* only used by celery, so this only
|
||||||
# matters in always eager mode :)
|
# matters in always eager mode :)
|
||||||
|
@ -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.open import setup_connection_and_db_from_config
|
||||||
from mediagoblin.db.util import MigrationManager
|
from mediagoblin.db.util import MigrationManager
|
||||||
from mediagoblin.workbench import WorkbenchManager
|
from mediagoblin.workbench import WorkbenchManager
|
||||||
|
from mediagoblin.storage import storage_system_from_config
|
||||||
|
|
||||||
|
|
||||||
class Error(Exception): pass
|
class Error(Exception): pass
|
||||||
@ -103,6 +104,19 @@ def get_staticdirector(app_config):
|
|||||||
"direct_remote_paths must be provided")
|
"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():
|
def setup_workbench():
|
||||||
app_config = mg_globals.app_config
|
app_config = mg_globals.app_config
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user