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

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

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

revision 1.35 by juri, Fri Oct 31 22:12:48 2003 UTC revision 1.36 by jmalonzo, Wed Nov 5 09:47:10 2003 UTC
# Line 5  Line 5 
5    
6  cvs_id = "$Id$"  cvs_id = "$Id$"
7    
 import urlparse  
 import urllib  
 import StringIO  
8  import straw  import straw
 from error import log  
9    
10  class Feed(object, straw.SignalEmitter):  class Feed(object, straw.SignalEmitter):
11      "A Feed object stores information set by user about a RSS feed."      "A Feed object stores information set by user about a RSS feed."
# Line 18  class Feed(object, straw.SignalEmitter): Line 14  class Feed(object, straw.SignalEmitter):
14                   '_id', '_channel_description',                   '_id', '_channel_description',
15                   '_channel_title', '_channel_link', '_channel_copyright',                   '_channel_title', '_channel_link', '_channel_copyright',
16                   'channel_lbd', 'channel_editor', 'channel_webmaster',                   'channel_lbd', 'channel_editor', 'channel_webmaster',
17                   '_channel_subscriptions_location', '_channel_blogroll_location',                   'channel_creator', '_previous_etag',
                  '_channel_subscriptions', '_channel_blogroll',  
                  'channel_blink', 'channel_creator', '_previous_etag',  
18                   '_error', '_process_status', 'router', 'sticky')                   '_error', '_process_status', 'router', 'sticky')
19    
20      __save_fields = (('_title', ""), ('_location', ""), ('_username', ""),      __save_fields = (('_title', ""), ('_location', ""), ('_username', ""),
# Line 55  class Feed(object, straw.SignalEmitter): Line 49  class Feed(object, straw.SignalEmitter):
49          self.channel_editor = ""          self.channel_editor = ""
50          self.channel_webmaster = ""          self.channel_webmaster = ""
51          self.channel_creator = ""          self.channel_creator = ""
         self._channel_subscriptions = ""  
         self._channel_subscriptions_location = ""  
         self._channel_blogroll = ""  
         self._channel_blogroll_location = ""  
         self.channel_blink = ""  
52          self._location = location          self._location = location
53          self._username = username          self._username = username
54          self._password = password          self._password = password
# Line 174  class Feed(object, straw.SignalEmitter): Line 163  class Feed(object, straw.SignalEmitter):
163              self.__setattr__(f, dict.get(f, default))              self.__setattr__(f, dict.get(f, default))
164          return          return
165    
     def complete_url(self, url):  
         url = urllib.quote(url, safe="/,:?=&#")  
         if urlparse.urlparse(url)[0] == '':  
             return urlparse.urljoin(self._location, url)  
         else:  
             return url  
   
166      def poll_done(self):      def poll_done(self):
167          self.emit_signal(straw.FeedPolledSignal(self))          self.emit_signal(straw.FeedPolledSignal(self))
168    
# Line 275  class Feed(object, straw.SignalEmitter): Line 257  class Feed(object, straw.SignalEmitter):
257    
258      error = property(get_error, set_error, None, "")      error = property(get_error, set_error, None, "")
259    
     def get_channel_blogroll(self):  
         return self._channel_blogroll  
   
     def set_channel_blogroll(self, data):  
         if data and len(data):  
             try:  
                 self._channel_blogroll = straw.OPMLImport.read(StringIO.StringIO(data))  
             except Exception, ex:  
                 raise ex  
   
     channel_blogroll = property(get_channel_blogroll, set_channel_blogroll,  
                                 None, "")  
   
     def get_channel_blogroll_location(self):  
         return self._channel_blogroll_location  
   
     def set_channel_blogroll_location(self, loc):  
         self._channel_blogroll_location = loc  
   
     channel_blogroll_location = property(get_channel_blogroll_location,  
                                          set_channel_blogroll_location, None, "")  
   
     def get_channel_subscriptions(self):  
         return self._channel_subscriptions  
   
     def set_channel_subscriptions(self, data):  
         if data and len(data):  
             try:  
                 self._channel_subscriptions = straw.OPMLImport.read(StringIO.StringIO(data))  
             except Exception, ex:  
                 raise ex  
   
     channel_subscriptions = property(get_channel_subscriptions,  
                                      set_channel_subscriptions, None, "")  
   
   
     def get_channel_subscriptions_location(self):  
         return self._channel_subscriptions_location  
   
     def set_channel_subscriptions_location(self, loc):  
         self._channel_subscriptions_location = loc  
   
     channel_subscriptions_location = property(get_channel_subscriptions_location,  
                                               set_channel_subscriptions_location, None, "")  
   
   
260      def set_process_status(self, status):      def set_process_status(self, status):
261          if status != self._process_status:          if status != self._process_status:
262              self._process_status = status              self._process_status = status

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

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