Merge branch 'feature/sourcescfg_fixes' into develop
This commit is contained in:
commit
484d10360c
19
sources.cfg.sample
Normal file
19
sources.cfg.sample
Normal file
@ -0,0 +1,19 @@
|
||||
[DEFAULT]
|
||||
reliability = Unknown
|
||||
|
||||
#For each source listed in FourmiCrawler/sources there should be a section
|
||||
#named exactly as the filename in here. If not present, the DEFAULT value is
|
||||
#used for reliability of that source.
|
||||
|
||||
[ChemSpider]
|
||||
reliability = High
|
||||
#token=Paste ChemSpider API token here and remove the hashtag
|
||||
|
||||
[NIST]
|
||||
reliability = High
|
||||
|
||||
[WikipediaParser]
|
||||
reliability = Medium
|
||||
|
||||
[PubChem]
|
||||
reliability = High
|
@ -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
|
||||
|
Reference in New Issue
Block a user