OSDN Git Service

Do not display 0
[fukui-no-namari/fukui-no-namari.git] / src / Hage1 / board_data.py
index b8102df..cb24ce8 100644 (file)
@@ -94,8 +94,8 @@ def load_modified_idxfiles(bbs, board, datalist):
                 datalist[thread_id] = dic
             elif idxlastModified > datalist[thread_id]["idxlastModified"]:
                 print "modified"
                 datalist[thread_id] = dic
             elif idxlastModified > datalist[thread_id]["idxlastModified"]:
                 print "modified"
+                datalist[thread_id]["idxlastModified"] = idxlastModified
                 dic = idxfile.load_idx(bbs, board, thread_id)
                 dic = idxfile.load_idx(bbs, board, thread_id)
-                dic["idxlastModified"] = idxlastModified
                 for name in idxfile.metadata_namelist:
                     datalist[thread_id][name] = dic[name]
 
                 for name in idxfile.metadata_namelist:
                     datalist[thread_id][name] = dic[name]
 
@@ -110,7 +110,8 @@ class LoadLocal(threading.Thread):
     def run(self):
         datalist = load_idxfiles(self.bbs, self.board)
         merge_local_subjecttxt(self.bbs, self.board, datalist)
     def run(self):
         datalist = load_idxfiles(self.bbs, self.board)
         merge_local_subjecttxt(self.bbs, self.board, datalist)
-        gobject.idle_add(self.on_end, datalist)
+        lastmod = subjecttxtfile.load_board_idx(self.bbs, self.board)
+        gobject.idle_add(self.on_end, datalist, lastmod)
 
 
 class GetRemote(threading.Thread):
 
 
 class GetRemote(threading.Thread):
@@ -122,7 +123,8 @@ class GetRemote(threading.Thread):
 
     def run(self):
         print "start get subject.txt"
 
     def run(self):
         print "start get subject.txt"
-        subjecttxt = subjecttxtfile.get_subjecttxt(self.bbs, self.board)
+        subjecttxt, lastmod = \
+                    subjecttxtfile.get_subjecttxt(self.bbs, self.board)
         datalist = load_idxfiles(self.bbs, self.board)
         merge_subjecttxt(subjecttxt, datalist)
         datalist = load_idxfiles(self.bbs, self.board)
         merge_subjecttxt(subjecttxt, datalist)
-        gobject.idle_add(self.on_end, datalist)
+        gobject.idle_add(self.on_end, datalist, lastmod)