Exemplo n.º 1
0
 def run(self):
     if internet():
         self.output = {
             "color": self.color,
             "full_text": self.format_online,
         }
     else:
         self.output = {
             "color": self.color_offline,
             "full_text": self.format_offline,
         }
Exemplo n.º 2
0
 def run(self):
     if internet():
         self.output = {
             "color": self.color,
             "full_text": self.format_online,
         }
     else:
         self.output = {
             "color": self.color_offline,
             "full_text": self.format_offline,
         }
Exemplo n.º 3
0
 def update_thread(self):
     if internet():
         self.interval = self.online_interval
     else:
         self.interval = self.offline_interval
     try:
         self.check_weather()
         while True:
             with self.condition:
                 self.condition.wait(self.interval)
             self.check_weather()
     except Exception:
         msg = 'Exception in {thread} at {time}, module {name}'.format(
             thread=threading.current_thread().name,
             time=time.strftime('%c'),
             name=self.__class__.__name__,
         )
         self.logger.error(msg, exc_info=True)
Exemplo n.º 4
0
 def update_thread(self):
     if internet():
         self.interval = self.online_interval
     else:
         self.interval = self.offline_interval
     try:
         self.check_weather()
         while True:
             with self.condition:
                 self.condition.wait(self.interval)
             self.check_weather()
     except Exception:
         msg = 'Exception in {thread} at {time}, module {name}'.format(
             thread=threading.current_thread().name,
             time=time.strftime('%c'),
             name=self.__class__.__name__,
         )
         self.logger.error(msg, exc_info=True)
Exemplo n.º 5
0
 def unread(self):
     if internet():
         conn = self.get_connection()
         self.last = len(conn.search(None, "UnSeen")[1][0].split())
     return self.last
Exemplo n.º 6
0
 def unread(self):
     if internet():
         conn = self.get_connection()
         self.last = len(conn.search(None, "UnSeen")[1][0].split())
     return self.last