From c0b618b7ca251cdd775092c6a6c1ac8d1ae9671d Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Wed, 4 Mar 2015 11:41:43 +0100 Subject: Updated the name of the command to invoke the crawler based on asyncio. Updated the documentation consequently. --- documentation/deployment.rst | 2 +- manager.py | 12 +++++------- pyaggr3g470r/utils.py | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/documentation/deployment.rst b/documentation/deployment.rst index d06d55fe..e04ed24a 100644 --- a/documentation/deployment.rst +++ b/documentation/deployment.rst @@ -145,6 +145,6 @@ For example if you want to check for updates every 30 minutes, add this line to .. code-block:: bash - */30 * * * * cd ~/.pyaggr3g470r/ ; python fetch.py firstname.lastname@mail.com + */30 * * * * cd ~/.pyaggr3g470r/ ; python manager.py fetch_asyncio None None You must give the email address you use to login to pyAggr3g470r. diff --git a/manager.py b/manager.py index c139d93b..c23f0c08 100755 --- a/manager.py +++ b/manager.py @@ -20,10 +20,9 @@ Migrate(application, db) manager = Manager(application) manager.add_command('db', MigrateCommand) - @manager.command def db_empty(): - "will drop every datas stocked in db" + "Will drop every datas stocked in db." # From http://www.sqlalchemy.org/trac/wiki/UsageRecipes/DropEverything conn = db.engine.connect() @@ -59,10 +58,9 @@ def db_empty(): trans.commit() - @manager.command def db_create(): - "Will create the database from conf parameters" + "Will create the database from conf parameters." with application.app_context(): populate_g() from pyaggr3g470r.models import User, Role @@ -82,17 +80,17 @@ def db_create(): db.session.add(user1) db.session.commit() - @manager.command def fetch(user, password, limit=10): + "Crawl the feeds with the client crawler." from pyaggr3g470r.lib.crawler import CrawlerScheduler scheduler = CrawlerScheduler(user, password) scheduler.run(limit=limit) scheduler.wait() @manager.command -def fetch_old(user_id, feed_id): - "Uses the old crawler (temporary)" +def fetch_asyncio(user_id, feed_id): + "Crawl the feeds with asyncio." with application.app_context(): populate_g() from pyaggr3g470r.models import User diff --git a/pyaggr3g470r/utils.py b/pyaggr3g470r/utils.py index a88c1a98..3ed89f55 100755 --- a/pyaggr3g470r/utils.py +++ b/pyaggr3g470r/utils.py @@ -79,7 +79,7 @@ def opened_w_error(filename, mode="r"): f.close() def fetch(id, feed_id=None): - cmd = [conf.PYTHON, conf.basedir+'/manager.py', 'fetch_old', str(id), str(feed_id)] + cmd = [conf.PYTHON, conf.basedir+'/manager.py', 'fetch_asyncio', str(id), str(feed_id)] p = subprocess.Popen(cmd, stdout=subprocess.PIPE) def import_opml(email, opml_content): -- cgit