aboutsummaryrefslogtreecommitdiff
path: root/feedgetter.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2012-03-04 08:37:07 +0100
committercedricbonhomme <devnull@localhost>2012-03-04 08:37:07 +0100
commit26b2f4f3ce39b94a32a60e4aa99e8b2aeb07cb20 (patch)
tree35909c8c76842e41017d643d2a93391faf2a99c8 /feedgetter.py
parentNotifications page is working. Improved get_all_collections function. (diff)
downloadnewspipe-26b2f4f3ce39b94a32a60e4aa99e8b2aeb07cb20.tar.gz
newspipe-26b2f4f3ce39b94a32a60e4aa99e8b2aeb07cb20.tar.bz2
newspipe-26b2f4f3ce39b94a32a60e4aa99e8b2aeb07cb20.zip
Removed useless code concerning SQLite and the update method (inotify) on the old database.
Diffstat (limited to 'feedgetter.py')
-rwxr-xr-xfeedgetter.py24
1 files changed, 2 insertions, 22 deletions
diff --git a/feedgetter.py b/feedgetter.py
index 74b7b3a0..b9d61c69 100755
--- a/feedgetter.py
+++ b/feedgetter.py
@@ -27,7 +27,6 @@ __license__ = "GPLv3"
import os.path
import traceback
-import sqlite3
import threading
import feedparser
import hashlib
@@ -52,15 +51,9 @@ class FeedGetter(object):
"""
Initializes the base and variables.
"""
- # Create the base if not exists.
- utils.create_base()
-
# MongoDB connections
self.articles = mongodb.Articles()
- # mutex to protect the SQLite base
- self.locker = threading.Lock()
-
def retrieve_feed(self):
"""
Parse the file 'feeds.lst' and launch a thread for each RSS feed.
@@ -89,25 +82,12 @@ class FeedGetter(object):
"""Request the URL
Executed in a thread.
- SQLite objects created in a thread can only be used in that same thread !
"""
- # Protect this part of code.
- self.locker.acquire()
-
- self.conn = sqlite3.connect(utils.sqlite_base, isolation_level = None)
- self.c = self.conn.cursor()
-
if utils.detect_url_errors([the_good_url]) == []:
# if ressource is available add the articles in the base.
- self.add_into_sqlite(the_good_url)
-
- self.conn.commit()
- self.c.close()
-
- # Release this part of code.
- self.locker.release()
+ self.add_into_database(the_good_url)
- def add_into_sqlite(self, feed_link):
+ def add_into_database(self, feed_link):
"""
Add the articles of the feed 'a_feed' in the SQLite base.
"""
bgstack15