updated parse_properties to use newresult function
This commit is contained in:
parent
b3b879d2ad
commit
0021953a9a
@ -84,13 +84,12 @@ class ChemSpider(Source):
|
|||||||
prop_value = m.group(1)
|
prop_value = m.group(1)
|
||||||
prop_conditions = m.group(2)
|
prop_conditions = m.group(2)
|
||||||
|
|
||||||
new_prop = Result({
|
new_prop = self.newresult(
|
||||||
'attribute': prop_name,
|
attribute=prop_name,
|
||||||
'value': prop_value,
|
value=prop_value,
|
||||||
'source': 'ChemSpider Predicted - ACD/Labs Tab',
|
source='ChemSpider Predicted - ACD/Labs Tab',
|
||||||
'reliability': 'Unknown',
|
conditions=prop_conditions
|
||||||
'conditions': prop_conditions
|
)
|
||||||
})
|
|
||||||
properties.append(new_prop)
|
properties.append(new_prop)
|
||||||
log.msg('CS prop: |%s| |%s| |%s|' %
|
log.msg('CS prop: |%s| |%s| |%s|' %
|
||||||
(new_prop['attribute'], new_prop['value'], new_prop['source']),
|
(new_prop['attribute'], new_prop['value'], new_prop['source']),
|
||||||
@ -108,14 +107,11 @@ class ChemSpider(Source):
|
|||||||
if line.xpath('span/text()'):
|
if line.xpath('span/text()'):
|
||||||
property_name = line.xpath('span/text()').extract()[0].rstrip()
|
property_name = line.xpath('span/text()').extract()[0].rstrip()
|
||||||
else:
|
else:
|
||||||
new_prop = Result({
|
new_prop = self.newresult(
|
||||||
'attribute': property_name[:-1],
|
attribute=property_name[:-1],
|
||||||
'value': line.xpath('text()').extract()[0].rstrip(),
|
value=line.xpath('text()').extract()[0].rstrip(),
|
||||||
'source': line.xpath(
|
source=line.xpath('strong/text()').extract()[0].rstrip(),
|
||||||
'strong/text()').extract()[0].rstrip(),
|
)
|
||||||
'reliability': 'Unknown',
|
|
||||||
'conditions': ''
|
|
||||||
})
|
|
||||||
properties.append(new_prop)
|
properties.append(new_prop)
|
||||||
log.msg('CS prop: |%s| |%s| |%s|' %
|
log.msg('CS prop: |%s| |%s| |%s|' %
|
||||||
(new_prop['attribute'], new_prop['value'],
|
(new_prop['attribute'], new_prop['value'],
|
||||||
|
Reference in New Issue
Block a user