Skip to content

Commit

Permalink
celerctl now supports --settings. Closes celery#48. Thanks to luopio
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Jul 15, 2011
1 parent 5d104b5 commit 26604c7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
17 changes: 17 additions & 0 deletions djcelery/management/base.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
import os
import sys

from django.core.management.base import BaseCommand

import celery
import djcelery



class CeleryCommand(BaseCommand):

def get_version(self):
return "celery %s\ndjango-celery %s" % (celery.__version__,
djcelery.__version__)

def handle_default_options(self, argv):
acc = []
for arg in argv:
if "--settings=" in arg:
_, settings_module = arg.split("=")
os.environ["DJANGO_SETTINGS_MODULE"] = settings_module
elif "--pythonpath=" in arg:
_, pythonpath = arg.split("=")
sys.path.insert(0, pythonpath)
else:
acc.append(arg)
return acc
1 change: 1 addition & 0 deletions djcelery/management/commands/celeryctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Curses Celery Event Viewer.
"""

from celery.bin.celeryctl import celeryctl, Command as _Command

from djcelery import __version__
Expand Down
1 change: 1 addition & 0 deletions djcelery/management/commands/celeryd_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Command(CeleryCommand):
option_list = ()

def run_from_argv(self, argv):
argv = self.handle_default_options(argv)
argv.append("--cmd=%s celeryd_detach" % (argv[0], ))
celeryd_multi.MultiTool().execute_from_commandline(
["%s %s" % (argv[0], argv[1])] + argv[2:])
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class CIRunTests(RunTests):
zip_safe=False,
install_requires=[
"django-picklefield",
"celery>=2.3.0",
"celery", #>=2.3.0",
],
cmdclass={"test": RunTests,
"quicktest": QuickRunTests,
Expand Down

0 comments on commit 26604c7

Please sign in to comment.