0.6.1-7, fix for broken feeds
authorYves <ymarcoz@n900-sdk.(none)>
Tue, 4 May 2010 04:49:45 +0000 (21:49 -0700)
committerYves <ymarcoz@n900-sdk.(none)>
Tue, 4 May 2010 04:49:45 +0000 (21:49 -0700)
debian/changelog
src/FeedingIt.py
src/feedingit_widget.py
src/rss.py

index bed2810..3813854 100644 (file)
@@ -1,3 +1,15 @@
+feedingit (0.6.1-7) unstable; urgency=low
+
+  * Added check for broken feeds
+
+ -- Yves <yves@marcoz.org>  Mon, 03 May 2010 21:44:19 -0800
+
+feedingit (0.6.1-6) unstable; urgency=low
+
+  * Fix for <em> tags
+
+ -- Yves <yves@marcoz.org>  Fri, 30 Apr 2010 20:54:19 -0800
+
 feedingit (0.6.1-5) unstable; urgency=low
 
   * Small performance fixes
index d1deb5a..b30d0e9 100644 (file)
@@ -594,11 +594,13 @@ class DisplayFeed(hildon.StackableWindow):
         self.buttons = {}
         for id in self.feed.getIds():
             title = self.feed.getTitle(id)
-            esc_title = unescape(title)
+            
+            esc_title = unescape(title).replace("<em>","").replace("</em>","")
             #title.replace("<em>","").replace("</em>","").replace("&amp;","&").replace("&mdash;", "-").replace("&#8217;", "'")
             button = gtk.Button(esc_title)
             button.set_alignment(0,0)
             label = button.child
+
             if self.feed.isEntryRead(id):
                 #label.modify_font(FontDescription("sans 16"))
                 label.modify_font(FontDescription(self.config.getReadFont()))
index 9a19a87..81ae611 100644 (file)
@@ -273,7 +273,8 @@ class FeedingItHomePlugin(hildondesktop.HomePluginItem):
             if self.autoupdate >0:
                 file = open("/home/user/.feedingit/feedingit_widget.log", "a")
                 from time import localtime, strftime
-                file.write("Widget: %s\n" % strftime("%a, %d %b %Y %H:%M:%S +0000", localtime()))
+                import os
+                file.write("Widget: pid:%s ppid:%s time:%s\n" % (os.getpid(), os.getppid(), strftime("%a, %d %b %Y %H:%M:%S +0000", localtime())))
                 file.close()
                 remote_object = bus.get_object("org.marcoz.feedingit", # Connection name
                               "/org/marcoz/feedingit/update" # Object's path
index e276116..59fa485 100644 (file)
@@ -537,8 +537,21 @@ class Listing:
         feed.editFeed(url)
 
     def getFeed(self, key):
-        feed = self.loadFeed(key)
-        feed.reloadUnread(self.configdir)
+        try:
+            feed = self.loadFeed(key)
+            feed.reloadUnread(self.configdir)
+        except:
+            # If the feed file gets corrupted, we need to reset the feed.
+            import dbus
+            bus = dbus.SessionBus()
+            remote_object = bus.get_object("org.freedesktop.Notifications", # Connection name
+                               "/org/freedesktop/Notifications" # Object's path
+                              )
+            iface = dbus.Interface(remote_object, 'org.freedesktop.Notifications')
+            iface.SystemNoteInfoprint("Error opening feed %s, it has been reset." % self.getFeedTitle(key))
+            if isdir(self.configdir+key+".d/"):
+                rmtree(self.configdir+key+".d/")
+            feed = self.loadFeed(key)
         return feed
     
     def getFeedUpdateTime(self, key):