From a272f9f6d6bd14e0345df2f70237d942d1bc1e70 Mon Sep 17 00:00:00 2001 From: RTB Date: Fri, 6 Jun 2014 18:58:33 +0200 Subject: [PATCH] updated parse_antoine_data to use newresult function --- FourmiCrawler/sources/NIST.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/FourmiCrawler/sources/NIST.py b/FourmiCrawler/sources/NIST.py index 209df56..f20d5ba 100644 --- a/FourmiCrawler/sources/NIST.py +++ b/FourmiCrawler/sources/NIST.py @@ -212,20 +212,17 @@ class NIST(Source): results.append(result) return results - @staticmethod - def parse_antoine_data(table, summary): + def parse_antoine_data(self, table, summary): """Parse table containing parameters for the Antione equation""" results = [] for tr in table.xpath('tr[td]'): tds = tr.xpath('td/text()').extract() - result = Result({ - 'attribute': summary, - 'value': 'A=%s, B=%s, C=%s' % (tds[1], tds[2], tds[3]), - 'source': 'NIST', - 'reliability': 'Unknown', - 'conditions': '%s K' % tds[0] - }) + result = self.newresult( + attribute=summary, + value='A=%s, B=%s, C=%s' % (tds[1], tds[2], tds[3]), + conditions='%s K' % tds[0] + ) results.append(result) return results