Commit graph

228 commits

Author SHA1 Message Date
Florent
99a2e554e8 Download bill on freemobile 2012-03-14 07:12:03 +01:00
Laurent Bachelier
006e97a8be PEP8 style fixes and other small style fixes
I used autopep8 on some files and did carefully check the changes.
I ignored E501,E302,E231,E225,E222,E221,E241,E203 in my search, and at
least E501 on any autopep8 run.

Other style fixes not related to PEP8:
* Only use new-style classes. I don't think the usage of old-style
  classes was voluntary. Old-style classes are removed in Python 3.
* Convert an if/else to a one-liner in mediawiki, change docstring style
  change to a comment something that wasn't really appropriate for a
  docstring.
* Unneeded first if condition in meteofrance
2012-03-14 04:51:46 +01:00
Romain Bignon
1e000acf3a remove unused imports 2012-03-13 22:45:39 +01:00
Laurent Bachelier
6ad93c7ea9 Use the helper function in the new capability
Revolutionary and magical.
2012-03-13 22:10: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
Florent
7c147cecab Add Bill object 2012-03-13 22:01:11 +01:00
Florent
0238392059 Add datetime field to Details 2012-03-13 22:01:06 +01:00
jems
24ab551694 add library capability and backend and application for archimede software aloes http://www.archimed.fr/aloes/presentation-et-avantages-12.html
Signed-off-by: jems <jems@ldjm.fr>
Signed-off-by: Romain Bignon <romain@symlink.me>
2012-03-13 21:57:38 +01:00
Florent
af7e827856 Change capability to iter and download document 2012-03-13 18:18:18 +01:00
Romain Bignon
ef07a9e795 do not use thumbnail_url anymore (closes #810), use set_empty_fields() method, do not give fields in constructor of BaseVideo anymore 2012-03-12 17:16:42 +01:00
Romain Bignon
56691d7ea7 rename iter_search_results to either search_videos and search_gallery (closes #779) 2012-03-12 16:24:33 +01:00
Romain Bignon
4afac2a0d0 add method CapBaseObject.set_empty_fields()
This method can be used to fill all empty fields with the same value.

A field is empty when is value is None, NotLoaded or NotAvailable.

Example:

     # It will be impossible to get all empty fields, except
     # of 'url' (with a call to fillobj())
     video.set_empty_fields(NotAvailable, ('url',))
2012-03-12 13:42:00 +01:00
Laurent Bachelier
42a1fee141 Fix account types and add account types support to bnporc, for the account types I could get.
Types were taken from KMyMoney, which is for personal tracking, however
some types had no use (cash not something the bank can provide,
maybe credit card but it is usually the "coming" field for us).
Sources: https://en.wikipedia.org/wiki/Bank_account (but not focused on
personal banking) and it's French translation which was more interesting.
Other websites for American and Australian banking almost always mentioned three
accounts: checking/current, savings/deposits, term/fixed deposits.

And some code refactoring.
2012-03-11 01:33:20 +01:00
Romain Bignon
008bf57264 add field Account.type 2012-03-10 09:04:46 +01:00
Laurent Bachelier
ee04a92f04 Support magnet URLs in weboorents 2012-03-09 02:49:00 +01:00
Laurent Bachelier
a31a751e28 Clean up the Torrent object
As discussed on IRC, those huge constructors aren't ideal.
Includes misc pep8 fixes.
2012-03-09 00:43:02 +01:00
Florent
72893d88a0 Add ICapBill 2012-02-26 18:34:41 +01:00
Romain Bignon
be14595308 apply changes to ICapBank API 2012-02-26 18:30:40 +01:00
Romain Bignon
b8d05430ec add a 'type' field on Transaction object 2012-02-26 15:05:04 +01:00
Romain Bignon
f5ca33f80e can looking for a rent or a sale 2012-02-19 18:35:33 +01:00
Romain Bignon
f6c2edc64f add a 'fullid' property to get 'ID@backend' 2012-02-18 12:27:18 +01:00
Romain Bignon
b6379f7f37 add parameter 'nb_rooms' in queries 2012-02-17 13:25:06 +01:00
Romain Bignon
8c7232f737 enhance ICapWaterLevel capability 2012-02-14 18:23:19 +01:00
Romain Bignon
20682b3e94 changes in the CapHounsing API 2012-02-14 18:21:11 +01:00
Florent
932e2cd416 Add a new capabilitie to display information about a gauge
Signed-off-by: Florent <weboob@flo.fourcot.fr>
Signed-off-by: Romain Bignon <romain@symlink.me>
2012-02-13 22:01:51 +01:00
Laurent Bachelier
9c5326c0e4 Make CapCollection a bit more useable
Collections are not stored in replapplication.objects anymore, but in
replapplication.collections. This fixes the IDs issue. There was no gain
from storing them in objects.

Completion right after cd should be faster (and should always have been
like that, it was pretty much a bug).

The display of do_ls() should be much clearer. Collections are always at
the end, have ids/title/backend like objects (but using a formatter
would be better than my current hack).

There are still many issues with the current implementation.
refs #774
closes #785
2012-02-12 15:49:08 +01:00
Romain Bignon
0c522d948a add housing photos 2012-02-11 19:06:39 +01:00
Romain Bignon
42d38f42f1 add capability CapHousing 2012-02-11 12:47:16 +01:00
Laurent Bachelier
5ea30516ac Fix incorrect translation
While this changes constants names, I think it is important as "accused" is
complely wrong. E-mails use the term "Read-receipts" so I chose
to go with RECEIVED.
2012-02-10 01:28:40 +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
Laurent Bachelier
a19b1be338 The past participle of split is "split", not "splitted" 2012-02-02 14:26:35 +01:00
Clément Schreiner
8afe645b0b ICapContact: manage personal notes about a contact 2011-12-04 11:14:53 +01:00
Romain Bignon
e55361d473 new Event object 2011-10-19 18:55:08 +02:00
Romain Bignon
97fe89ab66 profile is now a dict, not a list 2011-10-05 15:44:20 +02:00
Romain Bignon
51f8efc41d display the 'N' entry only when available 2011-09-09 09:54:07 +02:00
ffourcot
9d900578a3 Add a new field to Operations to permit a better export to qif
Signed-off-by: Romain Bignon <romain@peerfuse.org>
2011-09-08 17:58:47 +02:00
Romain Bignon
8eea2257a1 allow datetime.date type (in add to datetime.datetime) 2011-08-03 09:41:53 +02:00
Romain Bignon
80baf3800e fix license to AGPL 2011-07-24 19:55:28 +02:00
Romain Bignon
4a29a246a2 support changes of issue content 2011-07-19 13:24:33 +02:00
Romain Bignon
b9bba5924a ability to log spent time on an issue 2011-07-19 13:11:18 +02:00
Romain Bignon
c284a24842 ability to set an arrival or a departure time 2011-07-13 15:12:17 +02:00
Roger Philibert
c9614152f6 add basic support for Izneo 2011-07-13 11:46:08 +02:00
Romain Bignon
bc1d4921d0 new capability ICapBugTracker (closes #684) 2011-07-11 22:19:15 +02:00
Romain Bignon
6fa7a49349 support roadmaps in ICapTravel (closes #680) 2011-06-28 17:10:54 +02:00