/[straw]/straw/src/lib/PollManager.py
ViewVC logotype

Diff of /straw/src/lib/PollManager.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.34 by jmalonzo, Wed Nov 5 10:38:53 2003 UTC revision 1.35 by juri, Fri Nov 7 16:39:27 2003 UTC
# Line 12  class PollManager: Line 12  class PollManager:
12    
13      def maybe_poll(self):      def maybe_poll(self):
14          self.poll_network()          self.poll_network()
15            config = straw.Config.get_instance()
16            time_diff = int(time.time()) - config.last_poll
17    
18          time_diff = int(time.time()) - straw.config.last_poll          if config.poll_frequency > 0 and not config.offline and time_diff > config.poll_frequency:
   
         if straw.config.poll_frequency > 0 and not straw.config.offline and time_diff > straw.config.poll_frequency:  
19              self.poll()              self.poll()
20    
21          gtk.timeout_add(straw.NetworkConstants.POLL_INTERVAL, self.maybe_poll)          gtk.timeout_add(straw.NetworkConstants.POLL_INTERVAL, self.maybe_poll)
22    
23      def poll(self, feed = None):      def poll(self, feed = None):
24          if straw.config.offline:          config = straw.Config.get_instance()
25            if config.offline:
26              if feed is not None:              if feed is not None:
27                  e_title = _("Unable to Poll %s") % feed.title                  e_title = _("Unable to Poll %s") % feed.title
28                  e_body = _("You are currently offline. You have to be online to be able to poll this feed.")                  e_body = _("You are currently offline. You have to be online to be able to poll this feed.")
# Line 36  class PollManager: Line 37  class PollManager:
37          if feed:          if feed:
38              feeds = [feed]              feeds = [feed]
39          else:          else:
40              feeds = straw.config.feeds              feeds = config.feeds
41              straw.config.last_poll = int(time.time())              config.last_poll = int(time.time())
42    
43          straw.main.display_status_message(_("Polling feeds..."))          straw.main.display_status_message(_("Polling feeds..."))
44    

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26