Explorar el Código

timer2: Adds Entry.__repr__

Ask Solem hace 14 años
padre
commit
eacb5a2c29
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      celery/utils/timer2.py

+ 4 - 0
celery/utils/timer2.py

@@ -45,6 +45,10 @@ class Entry(object):
     def cancel(self):
         self.tref.cancelled = True
 
+    def __repr__(self):
+        return "<TimerEntry: %s(*%r, **%r)" % (
+                self.fun.__name__, self.args, self.kwargs)
+
 
 def to_timestamp(d):
     if isinstance(d, datetime):