Exemplo n.º 1
0
 def __update_time(self, timer):
     # modify interval.
     if self.__timer.Interval == 1:
         self.__timer.Interval = 1000
     # emit event.
     self.emit("send-time", self.get_time(), self.__tray_time_hour_type,
               cn_check())
 def get_time(self):
     #time_struct = time.localtime(time.time())
     #
     if self.__tray_time_hour_type == TRAY_TIME_12_HOUR: 
         time_show_text = time.strftime("%P %I %M", time.localtime()).split(" ")
         if cn_check() == TRAY_TIME_EN_TYPE:
             if time_show_text[0] == "上午":
                 time_show_text[0] = "AM"
             else:
                 time_show_text[0] = "PM"
     elif self.__tray_time_hour_type == TRAY_TIME_24_HOUR:
         time_show_text = time.strftime("%H %M", time.localtime()).split(" ")
     #
     return time_show_text