except sqlite3.Error:
return False
+# function to remove a category
+def remove_category (dbname, catid):
+ try:
+ conn = sqlite3.connect (dbname)
+ c = conn.cursor ()
+ c.execute ("DELETE FROM categories WHERE cid=?;", (catid,))
+ c.execute ("DELETE FROM articles WHERE cid=?;", (catid,))
+ conn.commit ()
+ conn.close ()
+ return True
+ except sqlite3.Error:
+ return False
+
# function to set the configuration and update the database
def set_configuration (dbname, site_title, site_url, keywords, description, copyright,
num_rss, dest_path):