OSDN Git Service

Cache exceptions. not trace IOError.
authorAiwota Programmer <aiwotaprog@tetteke.tk>
Mon, 25 Sep 2006 16:07:39 +0000 (01:07 +0900)
committerAiwota Programmer <aiwotaprog@tetteke.tk>
Mon, 25 Sep 2006 16:07:39 +0000 (01:07 +0900)
src/FukuiNoNamari/board_data.py

index baa92d6..d921f06 100644 (file)
@@ -89,19 +89,25 @@ class BoardData:
                             "lastModified": 0, "average": average}
 
     def merge_local_subjecttxt(self, datalist):
-        iterable = self._load_subjecttxt()
-
-        for id, title, res, num, lastmod in iterable:
-            self._merge_new_thread(datalist, id, title, res, num, lastmod)
-
-        status = "Complete subject file."
-        gobject.idle_add(self.set_status, status)
+        try:
+            for id, title, res, num, lastmod in self._load_subjecttxt():
+                self._merge_new_thread(datalist, id, title, res, num, lastmod)
+        except IOError:
+            pass
+        except:
+            tracebakc.print_exc()
+        else:
+            status = "Complete subject file."
+            gobject.idle_add(self.set_status, status)
 
     def merge_remote_subjecttxt(self, datalist):
-        iterable = self._get_subjecttxt()
-
-        for id, title, res, num, lastmod in iterable:
-            self._merge_new_thread(datalist, id, title, res, num, lastmod)
+        try:
+            for id, title, res, num, lastmod in self._get_subjecttxt():
+                self._merge_new_thread(datalist, id, title, res, num, lastmod)
+        except IOError:
+            pass
+        except:
+            traceback.print_exc()
 
     def _init_extra_data(self, dic):
         dic["num"] = 0