From 073b61fe53d4e499d7034bb8de2404cd87dc9095 Mon Sep 17 00:00:00 2001 From: Elrond Date: Sun, 19 Jun 2011 23:09:35 +0200 Subject: [PATCH] Move mediagoblin.celery_setup -> mediagoblin.init.celery As the first target of the new .init. submodule move celery_setup there. Quite straight forward, just a lot of places to change. --- docs/hackinghowto.rst | 2 +- mediagoblin/app.py | 2 +- mediagoblin/{celery_setup => init/celery}/__init__.py | 2 +- .../celery}/dummy_settings_module.py | 0 mediagoblin/{celery_setup => init/celery}/from_celery.py | 2 +- mediagoblin/{celery_setup => init/celery}/from_tests.py | 2 +- mediagoblin/tests/test_celery_setup.py | 2 +- mediagoblin/tests/test_mgoblin_app.ini | 2 +- mediagoblin/tests/tools.py | 8 ++++---- runtests.sh | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) rename mediagoblin/{celery_setup => init/celery}/__init__.py (97%) rename mediagoblin/{celery_setup => init/celery}/dummy_settings_module.py (100%) rename mediagoblin/{celery_setup => init/celery}/from_celery.py (97%) rename mediagoblin/{celery_setup => init/celery}/from_tests.py (95%) diff --git a/docs/hackinghowto.rst b/docs/hackinghowto.rst index 911f2340..08b228f1 100644 --- a/docs/hackinghowto.rst +++ b/docs/hackinghowto.rst @@ -150,7 +150,7 @@ celeryd in another window. Run:: - CELERY_CONFIG_MODULE=mediagoblin.celery_setup.from_celery ./bin/celeryd + CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_celery ./bin/celeryd Running the test suite diff --git a/mediagoblin/app.py b/mediagoblin/app.py index b27b5761..080c8e3a 100644 --- a/mediagoblin/app.py +++ b/mediagoblin/app.py @@ -25,7 +25,7 @@ from mediagoblin.config import ( read_mediagoblin_config, generate_validation_report) from mediagoblin.db.open import setup_connection_and_db_from_config from mediagoblin.mg_globals import setup_globals -from mediagoblin.celery_setup import setup_celery_from_config +from mediagoblin.init.celery import setup_celery_from_config from mediagoblin.workbench import WorkbenchManager diff --git a/mediagoblin/celery_setup/__init__.py b/mediagoblin/init/celery/__init__.py similarity index 97% rename from mediagoblin/celery_setup/__init__.py rename to mediagoblin/init/celery/__init__.py index e35dbce2..67c3dfa0 100644 --- a/mediagoblin/celery_setup/__init__.py +++ b/mediagoblin/init/celery/__init__.py @@ -20,7 +20,7 @@ import sys MANDATORY_CELERY_IMPORTS = ['mediagoblin.process_media'] -DEFAULT_SETTINGS_MODULE = 'mediagoblin.celery_setup.dummy_settings_module' +DEFAULT_SETTINGS_MODULE = 'mediagoblin.init.celery.dummy_settings_module' def setup_celery_from_config(app_config, global_config, diff --git a/mediagoblin/celery_setup/dummy_settings_module.py b/mediagoblin/init/celery/dummy_settings_module.py similarity index 100% rename from mediagoblin/celery_setup/dummy_settings_module.py rename to mediagoblin/init/celery/dummy_settings_module.py diff --git a/mediagoblin/celery_setup/from_celery.py b/mediagoblin/init/celery/from_celery.py similarity index 97% rename from mediagoblin/celery_setup/from_celery.py rename to mediagoblin/init/celery/from_celery.py index ed0a409e..c053591b 100644 --- a/mediagoblin/celery_setup/from_celery.py +++ b/mediagoblin/init/celery/from_celery.py @@ -17,7 +17,7 @@ import os from mediagoblin import app, mg_globals -from mediagoblin.celery_setup import setup_celery_from_config +from mediagoblin.init.celery import setup_celery_from_config OUR_MODULENAME = __name__ diff --git a/mediagoblin/celery_setup/from_tests.py b/mediagoblin/init/celery/from_tests.py similarity index 95% rename from mediagoblin/celery_setup/from_tests.py rename to mediagoblin/init/celery/from_tests.py index 779ecd65..b2293e2c 100644 --- a/mediagoblin/celery_setup/from_tests.py +++ b/mediagoblin/init/celery/from_tests.py @@ -17,7 +17,7 @@ import os from mediagoblin.tests.tools import TEST_APP_CONFIG -from mediagoblin.celery_setup.from_celery import setup_self +from mediagoblin.init.celery.from_celery import setup_self OUR_MODULENAME = __name__ diff --git a/mediagoblin/tests/test_celery_setup.py b/mediagoblin/tests/test_celery_setup.py index 8bf97ae4..d9222620 100644 --- a/mediagoblin/tests/test_celery_setup.py +++ b/mediagoblin/tests/test_celery_setup.py @@ -16,7 +16,7 @@ import pkg_resources -from mediagoblin import celery_setup +from mediagoblin.init import celery as celery_setup from mediagoblin.config import read_mediagoblin_config diff --git a/mediagoblin/tests/test_mgoblin_app.ini b/mediagoblin/tests/test_mgoblin_app.ini index e022d47b..fd0f87a4 100644 --- a/mediagoblin/tests/test_mgoblin_app.ini +++ b/mediagoblin/tests/test_mgoblin_app.ini @@ -8,7 +8,7 @@ email_debug_mode = true db_name = __mediagoblin_tests__ # Celery shouldn't be set up by the application as it's setup via -# mediagoblin.celery_setup.from_celery +# mediagoblin.init.celery.from_celery celery_setup_elsewhere = true [celery] diff --git a/mediagoblin/tests/tools.py b/mediagoblin/tests/tools.py index 64f773f0..966515d2 100644 --- a/mediagoblin/tests/tools.py +++ b/mediagoblin/tests/tools.py @@ -42,8 +42,8 @@ USER_DEV_DIRECTORIES_TO_SETUP = [ BAD_CELERY_MESSAGE = """\ Sorry, you *absolutely* must run nosetests with the -mediagoblin.celery_setup.from_tests module. Like so: -$ CELERY_CONFIG_MODULE=mediagoblin.celery_setup.from_tests ./bin/nosetests""" +mediagoblin.init.celery.from_tests module. Like so: +$ CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_tests ./bin/nosetests""" class BadCeleryEnviron(Exception): pass @@ -51,7 +51,7 @@ class BadCeleryEnviron(Exception): pass def suicide_if_bad_celery_environ(): if not os.environ.get('CELERY_CONFIG_MODULE') == \ - 'mediagoblin.celery_setup.from_tests': + 'mediagoblin.init.celery.from_tests': raise BadCeleryEnviron(BAD_CELERY_MESSAGE) @@ -59,7 +59,7 @@ def get_test_app(dump_old_app=True): suicide_if_bad_celery_environ() # Leave this imported as it sets up celery. - from mediagoblin.celery_setup import from_tests + from mediagoblin.init.celery import from_tests global MGOBLIN_APP diff --git a/runtests.sh b/runtests.sh index 9b96b17c..1dfbf093 100755 --- a/runtests.sh +++ b/runtests.sh @@ -27,4 +27,4 @@ else exit 1 fi -CELERY_CONFIG_MODULE=mediagoblin.celery_setup.from_tests $NOSETESTS $@ +CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_tests $NOSETESTS $@ -- 2.25.1