[CalendarServer-changes] [11073] CalendarServer/trunk/calendarserver/tools/workitems.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Apr 19 20:00:42 PDT 2013


Revision: 11073
          http://trac.calendarserver.org//changeset/11073
Author:   sagen at apple.com
Date:     2013-04-19 20:00:42 -0700 (Fri, 19 Apr 2013)
Log Message:
-----------
Catch some curses errors

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/workitems.py

Modified: CalendarServer/trunk/calendarserver/tools/workitems.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/workitems.py	2013-04-20 02:27:00 UTC (rev 11072)
+++ CalendarServer/trunk/calendarserver/tools/workitems.py	2013-04-20 03:00:42 UTC (rev 11073)
@@ -137,10 +137,20 @@
         y = 1
         for record in records:
             seconds = record.notBefore - datetime.datetime.utcnow()
-            self.window.addstr(y, x, "%d seconds" % int(seconds.total_seconds()))
+            try:
+                self.window.addstr(y, x, "%d seconds" % int(seconds.total_seconds()))
+            except curses.error:
+                continue
             y += 1
             if self.attrs:
-                self.window.addnstr(y, x, self.fmt % tuple([getattr(record, str(a)) for a in self.attrs]), self.ncols-2)
+                try:
+                    s = self.fmt % tuple([getattr(record, str(a)) for a in self.attrs])
+                except Exception, e:
+                    s = "Error: %s" % (str(e),)
+                try:
+                    self.window.addnstr(y, x, s, self.ncols-2)
+                except curses.error:
+                    pass
             y += 1
         self.window.refresh()
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130419/35a9ffc1/attachment.html>


More information about the calendarserver-changes mailing list