Archived
1
0

updated parse_extendedinfo to use the newresult function

This commit is contained in:
RTB 2014-06-06 18:17:55 +02:00
parent 755c981efa
commit b3b879d2ad

View File

@ -199,18 +199,16 @@ class ChemSpider(Source):
names = sel.xpath('*').xpath('name()').extract() names = sel.xpath('*').xpath('name()').extract()
values = sel.xpath('*').xpath('text()').extract() values = sel.xpath('*').xpath('text()').extract()
for (name, value) in zip(names, values): for (name, value) in zip(names, values):
result = Result({ result = self.newresult(
'attribute': name, attribute=name,
'value': value, # These values have no unit! value=value, # These values have no unit!
'source': 'ChemSpider ExtendedCompoundInfo', source='ChemSpider ExtendedCompoundInfo',
'reliability': 'Unknown', )
'conditions': ''
})
if result['value']: if result['value']:
properties.append(result) properties.append(result)
return properties return properties
def newresult(self, attribute, value, conditions, source='ChemSpider'): def newresult(self, attribute, value, conditions='', source='ChemSpider'):
return Result({ return Result({
'attribute': attribute, 'attribute': attribute,
'value': value, 'value': value,