Handle weboob errors
/code/weboob/modules/leboncoin/pages.py:40: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
if content.getroot():
/home/ben/.local/lib/python2.7/site-packages/weboob-1.3-py2.7.egg/weboob/capabilities/base.py:351: ConversionWarning: Value url was converted from <type 'str'> to <type 'unicode'>
self.__setattr__('url', url)
/home/ben/.local/lib/python2.7/site-packages/weboob-1.3-py2.7.egg/weboob/browser/elements.py:328: ConversionWarning: Value text was converted from <type 'str'> to <type 'unicode'>
setattr(self.obj, key, value)
/home/ben/.local/lib/python2.7/site-packages/weboob-1.3-py2.7.egg/weboob/browser/elements.py:328: ConversionWarning: Value rooms was converted from <type 'int'> to <class 'decimal.Decimal'>
setattr(self.obj, key, value)
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/code/flatisfy/flatisfy/__main__.py", line 197, in <module>
main()
File "/code/flatisfy/flatisfy/__main__.py", line 186, in main
cmds.import_and_filter(config, load_from_db=False)
File "flatisfy/cmds.py", line 102, in import_and_filter
fetch_details=(not load_from_db))
File "flatisfy/cmds.py", line 50, in filter_flats
details = fetch.fetch_details(config, flat["id"])
File "flatisfy/fetch.py", line 259, in fetch_details
weboob_output = weboob_proxy.info(flat_id)
File "flatisfy/fetch.py", line 210, in info
housing = backend.get_housing(flat_id)
File "/code/weboob/modules/entreparticuliers/module.py", line 54, in get_housing
return self.browser.get_housing(_id)
File "/code/weboob/modules/entreparticuliers/browser.py", line 125, in get_housing
obj = self.housing.go(data=data).get_housing(obj=obj)
File "/home/ben/.local/lib/python2.7/site-packages/weboob-1.3-py2.7.egg/weboob/browser/elements.py", line 50, in inner
return klass(self)(*args, **kwargs)
File "/home/ben/.local/lib/python2.7/site-packages/weboob-1.3-py2.7.egg/weboob/browser/elements.py", line 285, in __call__
for obj in self:
File "/home/ben/.local/lib/python2.7/site-packages/weboob-1.3-py2.7.egg/weboob/browser/elements.py", line 304, in __iter__
self.handle_attr(attr, getattr(self, 'obj_%s' % attr))
File "/home/ben/.local/lib/python2.7/site-packages/weboob-1.3-py2.7.egg/weboob/browser/elements.py", line 328, in handle_attr
setattr(self.obj, key, value)
File "/home/ben/.local/lib/python2.7/site-packages/weboob-1.3-py2.7.egg/weboob/capabilities/base.py", line 475, in __setattr__
name, actual_types, type(value)))
ValueError: Value for "rooms" needs to be of type (<class 'decimal.Decimal'>,), not <type 'unicode'>
We should catch this exception and at least output the id of the flat concerned.