Преглед изворни кода

timer2: Adds Entry.__repr__

Ask Solem пре 14 година
родитељ
комит
eacb5a2c29
1 измењених фајлова са 4 додато и 0 уклоњено
  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):