diff options
author | cedricbonhomme <devnull@localhost> | 2012-03-09 08:16:19 +0100 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2012-03-09 08:16:19 +0100 |
commit | 4b535d747257bd532ca838149a86d010099513d4 (patch) | |
tree | cb9b557b6c2cb89f841bc9f7d059c08cb7807051 | |
parent | MongoDB configuration (address, port, username and password) is loaded at lau... (diff) | |
download | newspipe-4b535d747257bd532ca838149a86d010099513d4.tar.gz newspipe-4b535d747257bd532ca838149a86d010099513d4.tar.bz2 newspipe-4b535d747257bd532ca838149a86d010099513d4.zip |
Removed create_base() for SQLite.
-rwxr-xr-x | utils.py | 32 |
1 files changed, 0 insertions, 32 deletions
@@ -364,38 +364,6 @@ def search_feed(url): return feed_link['href'] return None -def create_base(): - """ - Create the base if not exists. - """ - sqlite3.register_adapter(str, lambda s : s.decode('utf-8')) - conn = sqlite3.connect(sqlite_base, isolation_level = None) - c = conn.cursor() - # table of feeds - c.execute('''create table if not exists feeds - (feed_title text, feed_site_link text, \ - feed_link text PRIMARY KEY, feed_image_link text, - mail text)''') - # table of articles - c.execute('''create table if not exists articles - (article_date text, article_title text, \ - article_link text PRIMARY KEY, article_description text, \ - article_readed text, feed_link text, like text)''') - 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. |