From: Elrond Date: Fri, 10 Jun 2011 19:20:18 +0000 (+0200) Subject: celery_setup: drop param to setup_self and simplify OUR_MODULENAME X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e893094a06ab5d659b82c2d2fe646b1545c131dd;p=mediagoblin.git celery_setup: drop param to setup_self and simplify OUR_MODULENAME setup_self used to look like this: setup_self(setup_globals_func=setup_globals) The function isn't called with any param, so drop it. Rewrite function as needed. The module var OUR_MODULENAME just has the module's name in it. This is available as __name__ anyway, so use this to initialize the var. --- diff --git a/mediagoblin/celery_setup/from_celery.py b/mediagoblin/celery_setup/from_celery.py index 0669e80c..6fab59ca 100644 --- a/mediagoblin/celery_setup/from_celery.py +++ b/mediagoblin/celery_setup/from_celery.py @@ -23,13 +23,12 @@ from mediagoblin import storage from mediagoblin.db.open import setup_connection_and_db_from_config from mediagoblin.celery_setup import setup_celery_from_config from mediagoblin.globals import setup_globals -from mediagoblin import globals as mgoblin_globals -OUR_MODULENAME = 'mediagoblin.celery_setup.from_celery' +OUR_MODULENAME = __name__ -def setup_self(setup_globals_func=setup_globals): +def setup_self(): """ Transform this module into a celery config module by reading the mediagoblin config file. Set the environment variable @@ -76,7 +75,7 @@ def setup_self(setup_globals_func=setup_globals): queue_store = storage.storage_system_from_paste_config( mgoblin_section, 'queuestore') - setup_globals_func( + setup_globals( db_connection=connection, database=db, public_store=public_store, diff --git a/mediagoblin/celery_setup/from_tests.py b/mediagoblin/celery_setup/from_tests.py index fe7d7314..70814075 100644 --- a/mediagoblin/celery_setup/from_tests.py +++ b/mediagoblin/celery_setup/from_tests.py @@ -19,13 +19,12 @@ import os from mediagoblin.tests.tools import TEST_APP_CONFIG from mediagoblin import util from mediagoblin.celery_setup import setup_celery_from_config -from mediagoblin.globals import setup_globals -OUR_MODULENAME = 'mediagoblin.celery_setup.from_tests' +OUR_MODULENAME = __name__ -def setup_self(setup_globals_func=setup_globals): +def setup_self(): """ Set up celery for testing's sake, which just needs to set up celery and celery only.