diff feedupdate-main.py @ 5:bfd47f55d85b

add the updated date of the feed
author Dirk Olmes <dirk@xanthippe.ping.de>
date Mon, 26 Apr 2010 20:46:37 +0200
parents e0199f383442
children 87317ba41816
line wrap: on
line diff
--- a/feedupdate-main.py	Mon Apr 26 19:33:07 2010 +0200
+++ b/feedupdate-main.py	Mon Apr 26 20:46:37 2010 +0200
@@ -17,9 +17,10 @@
     return parser.get("database", "url")
 
 def createFeed(session):
-    newFeed = Feed("Joel on Software", "http://www.joelonsoftware.com/rss.xml")
-    session.add(newFeed)
-    session.commit()
+    if len(session.query(Feed).all()) == 0:
+        newFeed = Feed("Joel on Software", "http://www.joelonsoftware.com/rss.xml")
+        session.add(newFeed)
+        session.commit()
 
 def listFeeds(session):
     allFeeds = session.query(Feed)
@@ -36,5 +37,5 @@
     session = SessionMaker()
     
     #createFeed(session)
-    updateAllFeeds(session)
-    #listFeeds(session)
+    #updateAllFeeds(session)
+    listFeeds(session)