def tick(self, *_): """ Performs message dispatch """ tick_min=False tick_hour=False tick_day=False tick_second = (self.tick_count % self.ticks_second) == 0 self.tick_count += 1 if tick_second: self.sec_count += 1 if (self.sec_count % self.REFRESH_TIMEOUT)==0: self.refreshUi() tick_min=(self.sec_count % 60)==0 if tick_min: self.min_count += 1 tick_hour=(self.min_count % 60)==0 if tick_hour: self.hour_count += 1 tick_day=(self.hour_count % 24)==0 if tick_day: self.day_count += 1 #print "tick! ", tick_second mswitch.publish("__main__", "__tick__", self.ticks_second, tick_second, tick_min, tick_hour, tick_day, self.sec_count, self.min_count, self.hour_count, self.day_count) #(src_agent, agent_name, agent_id, # interest_map, responsesInterestList, # iq, isq, processor, low_priority_burst_size=5) quit=process_queues(False, self, "__main__", "__main__", self.interests, self.responsesInterests, self.iq, self.isq, message_processor ) if quit: self.on_destroy() ## for gobject... just in case return True
def tick(self, *_): """ Performs message dispatch """ tick_min = False tick_hour = False tick_day = False tick_second = (self.tick_count % self.ticks_second) == 0 self.tick_count += 1 if tick_second: self.sec_count += 1 if (self.sec_count % self.REFRESH_TIMEOUT) == 0: self.refreshUi() tick_min = (self.sec_count % 60) == 0 if tick_min: self.min_count += 1 tick_hour = (self.min_count % 60) == 0 if tick_hour: self.hour_count += 1 tick_day = (self.hour_count % 24) == 0 if tick_day: self.day_count += 1 #print "tick! ", tick_second mswitch.publish("__main__", "__tick__", self.ticks_second, tick_second, tick_min, tick_hour, tick_day, self.sec_count, self.min_count, self.hour_count, self.day_count) #(src_agent, agent_name, agent_id, # interest_map, responsesInterestList, # iq, isq, processor, low_priority_burst_size=5) quit = process_queues(False, self, "__main__", "__main__", self.interests, self.responsesInterests, self.iq, self.isq, message_processor) if quit: self.on_destroy() ## for gobject... just in case return True
def pub(self, msgType, *pargs, **kargs): mswitch.publish("__main__", msgType, *pargs, **kargs)
def exit(self, *p): mswitch.publish(self, "__quit__") gtk.main_quit()
def show(self, *_): mswitch.publish(self, "app_show")
def do_destroy(self, *_): #print "ui.window: destroy" mswitch.publish(self, "__destroy__")