diff options
Diffstat (limited to 'utils.py')
-rwxr-xr-x | utils.py | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -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. |