From d657f9420fe6b8348312b968af53d83a79b6a42e Mon Sep 17 00:00:00 2001 From: RTB Date: Tue, 17 Jun 2014 20:55:28 +0200 Subject: [PATCH] added absolute path to reading sources.cfg --- utils/configurator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/configurator.py b/utils/configurator.py index 62987c6..b443529 100644 --- a/utils/configurator.py +++ b/utils/configurator.py @@ -1,7 +1,7 @@ import ConfigParser from scrapy.utils.project import get_project_settings - +import os class Configurator: """ @@ -66,8 +66,11 @@ class Configurator: variables for sources :return a ConfigParser object of sources.cfg """ + current_dir = os.path.dirname(os.path.abspath(__file__)) + config_path = current_dir + '\..\sources.cfg' + # [TODO]: location of sources.cfg should be softcoded eventually config = ConfigParser.ConfigParser() - config.read('sources.cfg') # [TODO]: should be softcoded eventually + config.read(config_path) return config @staticmethod