From b1e4f338797d2168eb8c9e25a81eeae504d8bcae Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Wed, 21 Jan 2015 21:46:58 +0100 Subject: Set the version of Python used by the crawler in the configuration file. --- conf.py | 2 ++ conf/conf.cfg-sample | 1 + pyaggr3g470r/utils.py | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 7f72ff20..21d88299 100644 --- a/conf.py +++ b/conf.py @@ -38,6 +38,7 @@ if not ON_HEROKU: RECAPTCHA_PUBLIC_KEY = config.get('misc', 'recaptcha_public_key') RECAPTCHA_PRIVATE_KEY = config.get('misc', 'recaptcha_private_key') LOG_PATH = config.get('misc', 'log_path') + PYTHON = config.get('misc', 'python') WHOOSH_ENABLED = True @@ -69,6 +70,7 @@ else: RECAPTCHA_PUBLIC_KEY = os.environ.get('RECAPTCHA_PUBLIC_KEY', '') RECAPTCHA_PRIVATE_KEY = os.environ.get('RECAPTCHA_PRIVATE_KEY', '') LOG_PATH = os.environ.get('LOG_PATH', 'pyaggr3g470r.log') + PYTHON = os.environ.get('PYTHON', 'python3.3') SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL'] diff --git a/conf/conf.cfg-sample b/conf/conf.cfg-sample index 0135551a..aab5ab5f 100644 --- a/conf/conf.cfg-sample +++ b/conf/conf.cfg-sample @@ -4,6 +4,7 @@ admin_email = recaptcha_public_key = recaptcha_private_key = log_path = ./pyaggr3g470r/var/pyaggr3g470r.log +python = python3.3 [database] uri = postgres://pgsqluser:pgsqlpwd@127.0.0.1:5432/aggregator [feedparser] diff --git a/pyaggr3g470r/utils.py b/pyaggr3g470r/utils.py index d815d02b..1a3f55ff 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 = ['python', conf.basedir+'/fetch.py', str(id), str(feed_id)] + cmd = [conf.PYTHON, conf.basedir+'/fetch.py', str(id), str(feed_id)] p = subprocess.Popen(cmd, stdout=subprocess.PIPE) def import_opml(email, opml_content): -- cgit