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
-from mediagoblin.workbench import WorkbenchManager
+ setup_global_and_app_config, setup_workbench
class MediaGoblinApp(object):
db_connection=self.connection,
database=self.db,
public_store=self.public_store,
- queue_store=self.queue_store,
- workbench_manager=WorkbenchManager(app_config['workbench_path']))
+ queue_store=self.queue_store)
+ setup_workbench()
def __call__(self, environ, start_response):
request = Request(environ)
[wtforms.validators.Length(min=0, max=500)])
url = wtforms.TextField(
'Website',
- [wtforms.validators.URL(message='Improperly formed URL')])
+ [wtforms.validators.Optional(),
+ wtforms.validators.URL(message='Improperly formed URL')])
from mediagoblin import staticdirect
from mediagoblin.init.config import (
read_mediagoblin_config, generate_validation_report)
+from mediagoblin import mg_globals
from mediagoblin.mg_globals import setup_globals
+from mediagoblin.workbench import WorkbenchManager
class Error(Exception): pass
raise ImproperlyConfigured(
"One of direct_remote_path or "
"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)