diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-04-13 12:56:50 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-04-13 12:56:50 +0200 |
commit | 4e6c9024dddc5c09307fd06eb38ecd57916da102 (patch) | |
tree | 7b45b10f22dbadfdfec84e17f97b3a44a069967d /pyaggr3g470r | |
parent | Test of the new crawler with gevent. (diff) | |
download | newspipe-4e6c9024dddc5c09307fd06eb38ecd57916da102.tar.gz newspipe-4e6c9024dddc5c09307fd06eb38ecd57916da102.tar.bz2 newspipe-4e6c9024dddc5c09307fd06eb38ecd57916da102.zip |
The crawler is launched in a other process.
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r-- | pyaggr3g470r/views.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index ddc0ddf0..c2f49717 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -188,9 +188,13 @@ def fetch(feed_id=None): Triggers the download of news. """ #feed_getter = feedgetter.FeedGetter(g.user.email) - feed_getter = crawler.FeedGetter(g.user.email) - feed_getter.retrieve_feed(feed_id) - flash("New articles retrieved.", 'success') + import os, subprocess + cmd = ['python', conf.basedir+'/fetch.py', g.user.email, str(feed_id)] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE) + + #feed_getter = crawler.FeedGetter(g.user.email) + #feed_getter.retrieve_feed(feed_id) + flash("Downloading articles...", 'success') return redirect(redirect_url()) @app.route('/about/', methods=['GET']) |