"clicked", self.on_column_clicked, column_name)
self.treeview.append_column(self.treeviewcolumn[column_name])
+ self.treeviewcolumn["lastModified"].set_cell_data_func(
+ renderer, self.on_data_lastmodified)
+
sigdic = {"on_board_window_destroy": self.on_board_window_destroy,
"on_quit_activate": self.on_quit_activate,
"on_load_local_activate": self.on_load_local_activate,
"on_popup_menu_open_activate": self.on_open_thread}
self.mainwin.signal_autoconnect(sigdic)
+ def on_data_lastmodified(self, column, cell, model, iter, user_data=None):
+ lastmod = model.get_value(
+ iter, ThreadListModel.column_names.index("lastModified"))
+ if lastmod == 0:
+ cell.set_property("text", "")
+ else:
+ cell.set_property("text", time.strftime(
+ "%Y/%m/%d(%a) %H:%M:%S", time.localtime(lastmod)))
+
def on_board_window_destroy(self, widget):
gtk.main_quit()
start = int(id)
dic["average"] = int(res * 60 * 60 * 24 / (lastmod - start))
+ # lastModified
+ httpdate = dic["lastModified"]
+ try:
+ secs = misc.httpdate_to_secs(httpdate)
+ dic["lastModified"] = secs
+ except ValueError:
+ dic["lastModified"] = 0
+
list_list.append(dic)
model = self.treeview.get_model()
class ThreadListModel(gtk.GenericTreeModel):
- column_types = (str, int, str, int, int, str, int)
+ column_types = (str, int, str, int, int, int, int)
column_names = ["id", "num", "title", "res", "lineCount",
"lastModified", "average"]