Apply Neal's patch - Fixed os.remove
authorYves Marcoz <yves@marcoz.org>
Tue, 2 Aug 2011 04:06:06 +0000 (21:06 -0700)
committerYves Marcoz <yves@marcoz.org>
Tue, 2 Aug 2011 04:06:06 +0000 (21:06 -0700)
src/FeedingIt-Web.py
src/rss_sqlite.py

index 7f6b2a9..865b27f 100644 (file)
@@ -9,9 +9,10 @@ from gconf import client_get_default
 from urllib2 import ProxyHandler
 from threading import Thread
 from os.path import isfile, isdir, exists
-from os import mkdir, remove, stat
+from os import mkdir, remove, stat, environ
 
-CONFIGDIR = "/home/user/.feedingit/"
+CONFIGDIR = environ.get("HOME", "/home/user") + "/.feedingit"
+#CONFIGDIR = "/home/user/.feedingit/"
 
 updatingFeeds = []
 #commands = [("addFeed","httpwww"), ("openFeed", "xxxx"), ("openArticle", ("feedid","artid"))]
index e0f7e42..5b44369 100644 (file)
@@ -343,9 +343,9 @@ class Feed:
         contentLink = self.db.execute("SELECT contentLink FROM feed WHERE id=?;", (id,)).fetchone()[0]
         if contentLink:
             try:
-                os.remove(contentLink)
-            except:
-                print "File not found for deletion: %s" % contentLink
+                remove(contentLink)
+            except OSError, exception:
+                print "Deleting %s: %s" % (contentLink, str (exception))
         self.db.execute("DELETE FROM feed WHERE id=?;", (id,) )
         self.db.execute("DELETE FROM images WHERE id=?;", (id,) )
         self.db.commit()