Sfoglia il codice sorgente

timer2: Adds Entry.__repr__

Ask Solem 14 anni fa
parent
commit
eacb5a2c29
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  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):