Commit graph

50 commits

Author SHA1 Message Date
Florent
feb1405813 bump to 1.1 2014-10-17 14:10:38 +02:00
Laurent Bachelier
f4c17cdc9d pep8: Fix E303 too many blank lines 2014-10-11 02:15:28 +02:00
Laurent Bachelier
21e8f82fd7 pep8: Use "X not in Y" instead of "not X in Y"
flake8 --select E713, semi-manual fixing
2014-10-11 01:27:24 +02:00
Laurent Bachelier
448c06d125 pep8 blank lines fixes
flake8 --select W391,E302,E301,E304

autopep8 can't fix W391 even though it claims it can.
Fixed using a simple custom script.
2014-10-10 23:41:44 +02:00
Romain Bignon
d61e15cf84 rename things related to browsers
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
2014-10-07 00:30:07 +02:00
Florent
9949bbf919 Move exceptions to weboob.core.exceptions 2014-10-02 11:04:14 +02:00
Florent
0088013ae1 Rename BaseBrowser to Browser 2014-09-26 10:18:12 +02:00
Florent
444d36eee8 Rename BasePage to Page 2014-09-26 10:18:12 +02:00
Florent
5a1d83b567 Rename BaseModule to Module and Module to LoadedModule 2014-09-26 10:18:12 +02:00
Florent
f3aeddffbc Rename backend.py to module.py 2014-09-26 10:18:12 +02:00
Florent
9370b2fae7 s/Backend/Module 2014-09-26 10:18:11 +02:00
Florent
8559af3d6a s/BaseBackend/BaseModule 2014-09-26 10:18:11 +02:00
Florent
432f97e95c bump to 1.0 2014-09-03 17:14:10 +02:00
Romain Bignon
e025fb0b20 rename ICap to Cap (closes #1424) 2014-07-05 17:33:44 +02:00
Florent
9ca0bbae6a bump to 0.j 2014-05-19 22:45:35 +02:00
Romain Bignon
e434bb90e2 all browser2 modules may import exceptions from weboob.tools.exceptions 2014-05-17 14:27:56 +02:00
Romain Bignon
c50b6db86d fix variable redefinition 2014-03-30 14:08:20 +02:00
Romain Bignon
f8505d97c0 fix syntax to be compliant with python 2.6 2014-03-30 13:57:54 +02:00
Romain Bignon
f3ec952b3d fix parsing comments on redmine 2.4 2014-03-30 13:44:24 +02:00
Romain Bignon
343062771d fix parsing issue history on redmine 2.4 2014-03-30 13:35:21 +02:00
Romain Bignon
ce4c9f7d84 fix finding the control to add a note 2014-03-30 12:41:57 +02:00
Romain Bignon
07a1d04bb6 fix compatibility with redmine 2.4, support start/end/tracker/priority (courtesy of François Revol) 2014-03-30 12:33:56 +02:00
Romain Bignon
acf6f78419 fix compatibility with old versions of mechanize 2014-02-08 22:40:54 +01:00
Romain Bignon
1900a75b5c if category does not exist, try to create it 2014-02-08 17:58:16 +01:00
Romain Bignon
3fd1ff81df use the right method to get project 2014-02-08 17:58:16 +01:00
Romain Bignon
ec0cd3aa66 support new versions of redmine 2014-01-31 17:13:58 +01:00
Romain Bignon
02f40ccf2c add Issue.fields attribute to support custom fields 2014-01-22 00:00:43 +01:00
Florent
a82f57512c bump to 0.i 2014-01-08 23:40:16 +01:00
Florent
9b022b2ebe bump to 0.h 2013-08-03 14:31:13 +02:00
Laurent Bachelier
c108ca3fc5 redmine: Fix missing id class on older versions
Some version of redmine do not have td class="id". Luckily, we can
easily get it another way.
2013-07-27 21:36:01 +02:00
Romain Bignon
c0740e695d remove useless import of with_statement (we do not support anymore python2.5)
refs #806
2013-07-27 14:38:18 +02:00
Florent
9484099a1d bump to 0.g 2013-03-26 18:31:12 +01:00
Laurent Bachelier
7094931c92 Easy spacing fixes, trailing stuff
Remove useless trailing \
Remove trailing spaces
Add missing empty lines

autopep8 -ir -j2 --select=E301,E302,E502,W291,W293,W391 .

Diff quickly checked.
2013-03-16 00:54:55 +01:00
Laurent Bachelier
c21d1f7925 Code clarity fixes
autopep8 -ir -j2 --select=E303,E125
Diff checked manually.
2013-03-16 00:52:43 +01:00
Laurent Bachelier
f49084a6a9 redmine: Add support for the revision argument
refs #1067
2013-03-11 00:38:55 +01:00
Florent
bf3132e8c0 bump to 0.f 2013-01-25 17:23:49 +01:00
Romain Bignon
4a1e4b5afa bump to 0.e 2012-10-28 20:39:49 +01:00
Laurent Bachelier
3a66728392 Fix crashes with unicode characters in maintainer name
Change every mention of MAINTAINER to avoid future issues.
2012-10-24 13:29:30 +02:00
Romain Bignon
2f8072e89e bump to 0.d 2012-05-04 21:17:46 +02:00
Romain Bignon
8e391d0b88 bump to 0.c 2012-03-14 22:09:24 +01:00
Laurent Bachelier
fae4470101 Prepare for objects that are also Collections
Don't force objects to have an id, especially since that id was
incorrect. "plap/plop" would have the same id as "plop", i.e. "plop".
We don't rely on the id for handling Collections anymore.

Change to use more unique property names.

Change the display, instead of using '*', we use '~', and there is no
"Collection" header anymore.
Updated formatters could use that way of showing the object is also a
collection too.

refs #774
2012-03-13 22:08:46 +01:00
Laurent Bachelier
f4dbefb6ef Add some useful properties to Collection 2012-03-13 22:08:46 +01:00
Laurent Bachelier
1430b40bc5 Fix some collecton validation
And add restrict_level helper method.
2012-03-13 22:08:46 +01:00
Laurent Bachelier
e70a125ab9 Make collection validation more powerful
Handle and use exceptions.
An example is provided with the redmine backend (not very useful
though). If you cd into the project title instead of the id, it is
accepted and the path is corrected.
2012-03-13 22:08:46 +01:00
Laurent Bachelier
b6021d4732 Better path changing support
* Create a get_collection method similar to get_* methods for objects.
* Fix title initialization of a collection
* Remove the hack were both id and title were allowed when CDing.
  That hack only worked with the canalplus module, and failed with
  others like redmine (but they still showed in suggestions).
  Moreover, the canalplus module now has friendlier IDs
  so this is not really needed anymore.
* Allow backends to tell if a path is valid or not.
  For instance, it now allows to cd in a Redmine project with no issues
  in it. It also won't display "404" for invalid project IDs.
  By default, we still use the unreliable method of checking there is at
  least one result in iter_resources().
* Fix cd completion to work with unicode strings (all strings after an
  unicode string were ignored!)
* Do not suggest '..' when completing cd in the root

refs #774
2012-03-13 22:08:45 +01:00
Laurent Bachelier
b4b7182960 Make Collection more safe and sane
* 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 #774
fixes #773
2012-03-13 22:08:45 +01:00
Romain Bignon
4be4b40509 bump to 0.b 2012-02-05 19:35:30 +01:00
Laurent Bachelier
bfb3689456 Add object type filtering to iter_resources 2012-02-05 13:30:02 +01:00
Laurent Bachelier
682e14c86a Make CapCollection understandable and useable by humans
* Make the declaration of fct and it in the constructor Collection,
 instead of adding them from the outside
* Add a function to flatten a list containing collection (solves the
 radioob search crash)
* Better display of collections in the "ls" command (and display both id
 and title)
* The "cd" command goes to the root of the path (like the UNIX cd)
* Move the Video object of canalplus in a correct path
* Make Collection iterable
* Add comments to CapCollection
* Cache the result of fct in a Collection; it is only called once
* CollectionNotFound errors can be more explicit by providing a path
* Require utf-8 in collection paths
* Code cleanups
2012-02-02 23:44:13 +01:00
Romain Bignon
14a7a1d362 support repositories to manage backends (closes #747) 2012-01-17 17:00:05 +01:00