Beispiel #1
0
 def update_tweets(self, arr_tweets):
     if arr_tweets is None:
         self.stop_update(True, 'Oops... Algo salió mal. Actualizaré de nuevo pronto')
         return 0
     elif len(arr_tweets) == 0:
         self.stop_update(True, 'No hay tweets')
         return 0
     else:
         count = util.count_new_tweets(arr_tweets, self.last)
         self.stop_update()
         self.clear()
         for tweet in arr_tweets:
             self.add_tweet(tweet)
         self.last = arr_tweets
         
         return count
Beispiel #2
0
 def update_tweets(self, arr_tweets):
     if arr_tweets is None:
         self.stop_update(True, 'Oops... Algo salió mal. Actualizaré de nuevo pronto')
         return 0
     elif len(arr_tweets) == 0:
         self.stop_update(True, 'No hay tweets')
         return 0
     else:
         count = util.count_new_tweets(arr_tweets, self.last)
         self.stop_update()
         self.clear()
         for tweet in arr_tweets:
             self.add_tweet(tweet, False)
         self.last = arr_tweets
         #print self.page
         gobject.idle_add(self.list.load_string, self.page, "text/html", "utf-8", "timeline")
         return count
Beispiel #3
0
 def update_tweets(self, arr_tweets):
     if arr_tweets is None:
         self.stop_update(True,
                          _('Something went wrong. I\'ll update again soon'))
         return 0
     elif len(arr_tweets) == 0:
         self.stop_update(True, _('No tweets available'))
         return 0
     else:
         count = util.count_new_tweets(arr_tweets, self.last)
         self.stop_update()
         self.clear()
         for tweet in arr_tweets:
             self.add_tweet(tweet)
         self.last = arr_tweets
         
         return count
Beispiel #4
0
 def update_tweets(self, arr_tweets):
     if arr_tweets is None:
         self.stop_update(
             True, 'Oops... Algo salió mal. Actualizaré de nuevo pronto')
         return 0
     elif len(arr_tweets) == 0:
         self.stop_update(True, 'No hay tweets')
         return 0
     else:
         count = util.count_new_tweets(arr_tweets, self.last)
         self.stop_update()
         self.clear()
         for tweet in arr_tweets:
             self.add_tweet(tweet, False)
         self.last = arr_tweets
         #print self.page
         gobject.idle_add(self.list.load_string, self.page, "text/html",
                          "utf-8", "timeline")
         return count
Beispiel #5
0
 def update_tweets(self, arr_tweets):
     if arr_tweets is None:
         self.stop_update(True,
                          _('Something went wrong. I\'ll update again soon'))
         return 0
     elif len(arr_tweets) == 0:
         self.stop_update(True, _('No tweets available'))
         return 0
     else:
         count = util.count_new_tweets(arr_tweets, self.last)
         self.stop_update()
         self.clear()
         for tweet in arr_tweets:
             if not tweet:
                 continue
             #print tweet
             #print "**************"
             self.add_tweet(tweet)
         self.last = arr_tweets
         
         return count
Beispiel #6
0
 def update_tweets(self, response):
     if response.type == 'error':
         self.stop_update(True, response.errmsg)
         return 0
         
     arr_tweets = response.items
     if len(arr_tweets) == 0:
         self.clear()
         self.stop_update(True, _('No tweets available'))
         return 0
     else:
         count = util.count_new_tweets(arr_tweets, self.last)
         self.stop_update()
         self.clear()
         for tweet in arr_tweets:
             if not tweet:
                 continue
             self.add_tweet(tweet, False)
         self.last = arr_tweets
         gobject.idle_add(self.list.load_string, self.page, "text/html", "utf-8", "timeline")
         return count