updated parse_extendedinfo to use the newresult function
This commit is contained in:
parent
755c981efa
commit
b3b879d2ad
@ -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,
|
||||||
|
Reference in New Issue
Block a user