Commit c6b17ab8 authored by Edouard Lambert's avatar Edouard Lambert Committed by Romain Bignon
Browse files

fixing spirica : portfolio_share

parent 96133d1f
......@@ -22,7 +22,8 @@
from weboob.browser.pages import HTMLPage, LoggedPage
from weboob.browser.elements import ItemElement, TableElement, SkipItem, method
from weboob.browser.filters.standard import CleanText, Date, Regexp, CleanDecimal, Env, TableCell, Field, Async, AsyncLoad
from weboob.browser.filters.standard import CleanText, Date, Regexp, CleanDecimal, \
Env, TableCell, Field, Async, AsyncLoad, Eval
from weboob.browser.filters.html import Attr, Link
from weboob.capabilities.bank import Account, Investment, Transaction
from weboob.capabilities.base import NotAvailable
......@@ -109,7 +110,7 @@ class item(ItemElement):
obj_unitvalue = MyDecimal(TableCell('unitvalue'))
obj_valuation = MyDecimal(TableCell('valuation'))
obj_vdate = Date(CleanText(TableCell('vdate')), dayfirst=True, default=NotAvailable)
obj_portfolio_share = MyDecimal(TableCell('portfolio_share'))
obj_portfolio_share = Eval(lambda x: x / 100, MyDecimal(TableCell('portfolio_share')))
def obj_unitprice(self):
return MyDecimal('//div[contains(@id, "PRIX_REVIENT")]//a[contains(text(), \
......@@ -172,7 +173,7 @@ def get_investments(self, el, xpath='.'):
if "valuation" in positions else NotAvailable
i.vdate = Date(CleanText('./td[%s]' % positions['vdate']), dayfirst=True, default=NotAvailable)(tr) \
if "vdate" in positions else NotAvailable
i.portfolio_share = MyDecimal().filter(tr.xpath('./td[%s]' % positions['portfolio_share'])) \
i.portfolio_share = Eval(lambda x: x / 100).filter([MyDecimal().filter(tr.xpath('./td[%s]' % positions['portfolio_share']))]) \
if "portfolio_share" in positions else NotAvailable
investments.append(i)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment