[weboob] [PATCH 1/1] [piratebay] ported to browser2

Florent weboob at flo.fourcot.fr
Fri Mar 18 11:18:10 CET 2016


Hello,



> ---
>   modules/piratebay/browser.py        |  48 ++++---------
>   modules/piratebay/module.py         |   2 +-
>   modules/piratebay/pages/index.py    |   4 +-
>   modules/piratebay/pages/torrents.py | 132 ++++++++++++------------------------
>   weboob/browser/filters/standard.py  |   9 ++-
>   weboob/tools/misc.py                |   4 ++
>   6 files changed, 73 insertions(+), 126 deletions(-)
>


Changes on modules and on core must always be in separates patches (to 
help backporting of module patches, to have an easy to read history, 
etc). I can split it for you if you want.




>       @debug()
>       def filter(self, el):
>           if isinstance(el, (tuple, list)):
> @@ -317,7 +321,10 @@ class RawText(Filter):
>           if el.text is None:
>               return self.default
>           else:
> -            return unicode(el.text)
> +            if self.children:
> +                return unicode(el.text_content())
> +            else:
> +                return unicode(el.text)
>
>

Minor: why not something like it:

    if el.text is None:
        return self.default

    if self.children:
        return unicode(el.text_content())

    return unicode(el.text)



More information about the weboob mailing list