From 755c981efa83adb97a8826b07e14431729d982f5 Mon Sep 17 00:00:00 2001 From: RTB Date: Fri, 6 Jun 2014 18:12:31 +0200 Subject: [PATCH] created newresult function that uses the config for reliability --- FourmiCrawler/sources/ChemSpider.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/FourmiCrawler/sources/ChemSpider.py b/FourmiCrawler/sources/ChemSpider.py index 1d79019..0357477 100644 --- a/FourmiCrawler/sources/ChemSpider.py +++ b/FourmiCrawler/sources/ChemSpider.py @@ -210,6 +210,15 @@ class ChemSpider(Source): properties.append(result) return properties + def newresult(self, attribute, value, conditions, source='ChemSpider'): + return Result({ + 'attribute': attribute, + 'value': value, + 'source': source, + 'reliability': self.cfg['reliability'], + 'conditions': conditions + }) + def parse_searchrequest(self, response): """Parse the initial response of the ChemSpider Search API """ sel = Selector(response)