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()
values = sel.xpath('*').xpath('text()').extract()
for (name, value) in zip(names, values):
result = Result({
'attribute': name,
'value': value, # These values have no unit!
'source': 'ChemSpider ExtendedCompoundInfo',
'reliability': 'Unknown',
'conditions': ''
})
result = self.newresult(
attribute=name,
value=value, # These values have no unit!
source='ChemSpider ExtendedCompoundInfo',
)
if result['value']:
properties.append(result)
return properties
def newresult(self, attribute, value, conditions, source='ChemSpider'):
def newresult(self, attribute, value, conditions='', source='ChemSpider'):
return Result({
'attribute': attribute,
'value': value,