def check(buf, num=90): """ Get the first X new messages. Defaults to 30. Args: buf - buffer passed from the menu object num - number of messages to get """ if debug: print("checking new messages") new = zw_lib.get_recent(s, num) if debug: print("got %d recent msgs" % len(new)) for row in new: if row[1] == "*": msg_from = row[3] if row[5].strip(): msg_from = row[5] date = row[2] msg_body = row[4].strip() msg_id = row[0] msg = message(msg_id, msg_from, msg_body, date) n = notify(msg) n.display() return
def readmsgs(buf, num=190): """ View recent messages in a list window. Args: buf - buffer passed from the menu object num - number of messages to get """ s = zw_lib.authenticate() recent = zw_lib.get_recent(s, num) win = CellRendererTextWindow(recent) win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main()