Archived
1
0

updated parse_individidual_datapoints to use newresult function

This commit is contained in:
RTB 2014-06-06 18:54:38 +02:00
parent de21891bff
commit e347b7538d

View File

@ -230,8 +230,7 @@ class NIST(Source):
return results return results
@staticmethod def parse_individual_datapoints(self, response):
def parse_individual_datapoints(response):
"""Parses the page linked from aggregate data""" """Parses the page linked from aggregate data"""
sel = Selector(response) sel = Selector(response)
table = sel.xpath('//table[@class="data"]')[0] table = sel.xpath('//table[@class="data"]')[0]
@ -258,13 +257,11 @@ class NIST(Source):
if m: if m:
uncertainty = '+- %s ' % m.group(1) uncertainty = '+- %s ' % m.group(1)
# [TODO]: get the plusminus sign working in here # [TODO]: get the plusminus sign working in here
result = Result({ result = self.newresult(
'attribute': name, attribute=name,
'value': '%s %s%s' % (tds[0], uncertainty, unit), value='%s %s%s' % (tds[0], uncertainty, unit),
'source': 'NIST', conditions=condition
'reliability': 'Unknown', )
'conditions': condition
})
results.append(result) results.append(result)
return results return results