added absolute path to reading sources.cfg
This commit is contained in:
parent
9542262bf7
commit
d657f9420f
@ -1,7 +1,7 @@
|
|||||||
import ConfigParser
|
import ConfigParser
|
||||||
|
|
||||||
from scrapy.utils.project import get_project_settings
|
from scrapy.utils.project import get_project_settings
|
||||||
|
import os
|
||||||
|
|
||||||
class Configurator:
|
class Configurator:
|
||||||
"""
|
"""
|
||||||
@ -66,8 +66,11 @@ class Configurator:
|
|||||||
variables for sources
|
variables for sources
|
||||||
:return a ConfigParser object of sources.cfg
|
: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 = ConfigParser.ConfigParser()
|
||||||
config.read('sources.cfg') # [TODO]: should be softcoded eventually
|
config.read(config_path)
|
||||||
return config
|
return config
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Reference in New Issue
Block a user