Commits

Guido Draheim committed 1cfb867

better error reporting

  • Participants
  • Parent commits f659f21

Comments (0)

Files changed (1)

File src/dvbcronrecording/computer.py

         return item
     def __unicode__(self):
         return u"(%s) '%s'" % (unicode(self.months), unicode(self.title))
+    def __str__(self):
+        return unicode(self).encode("UTF-8")
     
 class RecorderGroup:
     def __init__(self):
             self.endtimeMMM = orig.endtimeMMM
             self.extratimeM = orig.extratimeM
         return self
+    def __unicode__(self):
+        return u"[%s - %s] %s" % (self.datetimeX, self.datetimeY, unicode(self.item))
+    def __str__(self):
+        return unicode(self).encode("UTF-8")
 
 months_ahead = 3
     
                 previous = current
                 continue # nothing to do - there is a gap
             if previous.datetimeX > current.datetimeX:
-                raise Exception("previous starts after current")
+                msg = (u"previous starts after current\nPREV %s\nNEXT %s" 
+                       % (previous, current))
+                raise Exception(msg)
             overlapY = previous.datetimeY - current.datetimeX
             overlapM = deltaM(overlapY)
             assert overlapM > 0