Factor setup_workbench into init submodule.
This commit is contained in:
parent
cca5d55d40
commit
7664b4db81
@ -25,8 +25,7 @@ from mediagoblin.db.open import setup_connection_and_db_from_config
|
|||||||
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_global_and_app_config, setup_workbench
|
||||||
from mediagoblin.workbench import WorkbenchManager
|
|
||||||
|
|
||||||
|
|
||||||
class MediaGoblinApp(object):
|
class MediaGoblinApp(object):
|
||||||
@ -104,8 +103,8 @@ class MediaGoblinApp(object):
|
|||||||
db_connection=self.connection,
|
db_connection=self.connection,
|
||||||
database=self.db,
|
database=self.db,
|
||||||
public_store=self.public_store,
|
public_store=self.public_store,
|
||||||
queue_store=self.queue_store,
|
queue_store=self.queue_store)
|
||||||
workbench_manager=WorkbenchManager(app_config['workbench_path']))
|
setup_workbench()
|
||||||
|
|
||||||
def __call__(self, environ, start_response):
|
def __call__(self, environ, start_response):
|
||||||
request = Request(environ)
|
request = Request(environ)
|
||||||
|
@ -31,4 +31,5 @@ class EditProfileForm(wtforms.Form):
|
|||||||
[wtforms.validators.Length(min=0, max=500)])
|
[wtforms.validators.Length(min=0, max=500)])
|
||||||
url = wtforms.TextField(
|
url = wtforms.TextField(
|
||||||
'Website',
|
'Website',
|
||||||
[wtforms.validators.URL(message='Improperly formed URL')])
|
[wtforms.validators.Optional(),
|
||||||
|
wtforms.validators.URL(message='Improperly formed URL')])
|
||||||
|
@ -18,7 +18,9 @@ import jinja2
|
|||||||
from mediagoblin import staticdirect
|
from mediagoblin import staticdirect
|
||||||
from mediagoblin.init.config import (
|
from mediagoblin.init.config import (
|
||||||
read_mediagoblin_config, generate_validation_report)
|
read_mediagoblin_config, generate_validation_report)
|
||||||
|
from mediagoblin import mg_globals
|
||||||
from mediagoblin.mg_globals import setup_globals
|
from mediagoblin.mg_globals import setup_globals
|
||||||
|
from mediagoblin.workbench import WorkbenchManager
|
||||||
|
|
||||||
|
|
||||||
class Error(Exception): pass
|
class Error(Exception): pass
|
||||||
@ -70,3 +72,11 @@ def get_staticdirector(app_config):
|
|||||||
raise ImproperlyConfigured(
|
raise ImproperlyConfigured(
|
||||||
"One of direct_remote_path or "
|
"One of direct_remote_path or "
|
||||||
"direct_remote_paths must be provided")
|
"direct_remote_paths must be provided")
|
||||||
|
|
||||||
|
|
||||||
|
def setup_workbench():
|
||||||
|
app_config = mg_globals.app_config
|
||||||
|
|
||||||
|
workbench_manager = WorkbenchManager(app_config['workbench_path'])
|
||||||
|
|
||||||
|
setup_globals(workbench_manager = workbench_manager)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user