aboutsummaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils.py')
-rwxr-xr-xutils.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/utils.py b/utils.py
index a6822685..7a9d7f81 100755
--- a/utils.py
+++ b/utils.py
@@ -2,8 +2,8 @@
#-*- coding: utf-8 -*-
__author__ = "Cedric Bonhomme"
-__version__ = "$Revision: 0.8 $"
-__date__ = "$Date: 2010/07/05 $"
+__version__ = "$Revision: 0.9 $"
+__date__ = "$Date: 2010/07/08 $"
__copyright__ = "Copyright (c) 2010 Cedric Bonhomme"
__license__ = "GPLv3"
@@ -219,6 +219,18 @@ def create_base():
conn.commit()
c.close()
+def drop_base():
+ """
+ Delete all articles from the database.
+ """
+ sqlite3.register_adapter(str, lambda s : s.decode('utf-8'))
+ conn = sqlite3.connect(sqlite_base, isolation_level = None)
+ c = conn.cursor()
+ c.execute('''DROP TABLE IF EXISTS feeds''')
+ c.execute('''DROP TABLE IF EXISTS articles''')
+ conn.commit()
+ c.close()
+
def load_feed():
"""
Load feeds and articles in a dictionary.
bgstack15