Skip to content

Commit af4bbd3

Browse files
committed
add replace_celery.py
1 parent a90d2b4 commit af4bbd3

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

replace_celery.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from __future__ import absolute_import, unicode_literals
2+
3+
from celery.bin import celery
4+
5+
from djcelery.app import app
6+
from djcelery.management.base import CeleryCommand
7+
8+
base = celery.CeleryCommand(app=app)
9+
10+
11+
class Command(CeleryCommand):
12+
"""The celery command."""
13+
help = 'celery commands, see celery help'
14+
cc_options = CeleryCommand.options if CeleryCommand.options else []
15+
base_options = base.get_options() if base.get_options() else []
16+
if hasattr(base, "preload_options"):
17+
preload_options = basffffe.preload_options if base.preload_options else []
18+
else:
19+
preload_options = []
20+
preload_options = base.preload_options if base.preload_options else []
21+
# options = (cc_options +
22+
# base_options +
23+
# preload_options)
24+
25+
def run_from_argv(self, argv):
26+
argv = self.handle_default_options(argv)
27+
base.execute_from_commandline(
28+
['{0[0]} {0[1]}'.format(argv)] + argv[2:],
29+
)

0 commit comments

Comments
 (0)