Ask Solem 10 years ago
parent
commit
37befb163b
2 changed files with 7 additions and 5 deletions
  1. 3 1
      celery/bin/celery.py
  2. 4 4
      celery/bin/logtool.py

+ 3 - 1
celery/bin/celery.py

@@ -31,6 +31,7 @@ from celery.bin.amqp import amqp
 from celery.bin.beat import beat
 from celery.bin.events import events
 from celery.bin.graph import graph
+from celery.bin.logtool import logtool
 from celery.bin.worker import worker
 
 __all__ = ['CeleryCommand', 'main']
@@ -58,7 +59,7 @@ command_classes = [
 ]
 if DEBUG:  # pragma: no cover
     command_classes.append(
-        ('Debug', ['graph'], 'red'),
+        ('Debug', ['graph', 'logtool'], 'red'),
     )
 
 
@@ -670,6 +671,7 @@ class CeleryCommand(Command):
         'help': help,
         'inspect': inspect,
         'list': list_,
+        'logtool': logtool,
         'migrate': migrate,
         'multi': multi,
         'purge': purge,

+ 4 - 4
celery/bin/logtool.py

@@ -14,9 +14,6 @@ import re
 from collections import Counter
 from fileinput import FileInput
 
-from celery.datastructures import DependencyGraph, GraphFormatter
-from celery.five import items
-
 from .base import Command
 
 __all__ = ['logtool']
@@ -48,6 +45,7 @@ class _task_counts(list):
     def format(self):
         return '\n'.join('{0}: {1}'.format(*i) for i in self)
 
+
 def task_info(line):
     m = RE_TASK_INFO.match(line)
     return m.groups()
@@ -143,7 +141,9 @@ class logtool(Command):
         if not what:
             raise self.UsageError('missing action')
         elif what not in map:
-            raise self.Error('no action {0} in {1}'.format(what, '|'.join(map)))
+            raise self.Error(
+                'action {0} not in {1}'.format(what, '|'.join(map)),
+            )
 
         return map[what](files)