weboob.tools.browser -> weboob.deprecated.browser
weboob.tools.parsers -> weboob.deprecated.browser.parsers
weboob.tools.mech -> weboob.deprecated.mech
weboob.browser2 -> weboob.browser
weboob.core.exceptions -> weboob.exceptions
Also, the new tree for browser2 is:
weboob.browser: import weboob.browser.browsers.* and weboob.browser.url.*
weboob.browser.browsers: all browsers (including PagesBrowser and LoginBrowser)
weboob.browser.url: the URL class
weboob.browser.profiles: all Profile classes
weboob.browser.sessions: WeboobSession and FuturesSession
weboob.browser.cookies: that's a cookies thing
weboob.browser.pages: all Page and derivated classes, and Form class
weboob.browser.exceptions: specific browser exceptions
weboob.browser.elements: AbstractElement classes, and 'method' decorator
weboob.browser.filters.*: all filters
With flake8, we can check for more issues and ignore those who are not
real issues.
This allowed me to find genuine errors in:
- modules/boursorama/pages/account_history.py
- modules/ing/pages/login.py
- weboob/tools/application/qt/qt.py
I left one in weboob/tools/browser/browser.py for the time being.
Some PEP8 fixes on other files.
FIP now uses the same website as most Radio France radios.
As a consequence, it is able to support CapVideo.
There are a few differences between FIP and the other radios, but this
still allowed for less code, and the code should be more robust for
every radio.
* Remove callbacks in Collection object
Make Collection a "dumb" object (and also a base object,
though it isn't very useful for now)
* Rename Path to WorkingPath, because it is more about managing state
than being a single path.
* Rewrite almost all WorkingPath, because the code was overly
complicated for no reason (I tried some special cases and it turned
out that fromstring didn't handle them, and that the
quote-escape-unquote was just unecessary). I also rewrote it to be
more pythonic (no more lambdas and maps) and added tests.
* Require the full split path when creating a Collection. Because, come to
think of it, an object needs an unique identifier; in the case of
Collections, it is the full path, not only its last part.
I might even replace the id by the full split path in the future.
* There is now only one way to get items of a Collection: calling
iter_resources().
* Rewrite flatten_resources to iter_resources_flat(), which just calls
iter_resources() recursively.
* Rewrite the collection part of the canalplus module. There is no more
callback or a page calling the browser to check another page!
The logic is only in iter_resources().
The resulting code is not very pretty, but it should get better.
As a bonus, avoid to reload the main XML file when we already have it
open.
* change_path() now expects a split path and not a string.
* up/home special cases for "cd" are handled in the same place, and
store the previous place properly (but are not yet exploitable by
an user command).
This is a big commit but it would be hard to split it in *working*
commits.
If you read this entire commit message, I will buy you a beer.
refs #774fixes#773