Commit graph

270 commits

Author SHA1 Message Date
Laurent Bachelier
81e3da8bb0 More robust currency guessing
This allows to parse PayPal balances which includes both symbol and letters, for
instance "$ 42,00 USD".
Also, it does not require adding any new symbols to the regular
expression.
It might break modules, though numerous cases were tested.
2013-02-05 16:32:17 +01:00
Romain Bignon
8550c17cf7 do not cry if an object in not support to be filled by a backend 2013-01-30 11:34:28 +01:00
Florent
3daf7af5a9 Change representation of Gauges objects 2013-01-10 14:56:56 +01:00
Florent
d8f8eed50d Add more information about an account 2013-01-08 20:28:08 +01:00
Romain Bignon
922bf1d465 currency detection is now case insensitive 2013-01-03 18:04:06 +01:00
Florent
a7af6b2c6e Add __repr__ function for sensors objects 2012-12-30 16:30:10 +01:00
Romain Bignon
d91dad2b2b support currencies 2012-12-06 13:21:13 +01:00
Florent
c838b91fb2 Add SensorNotFound exception 2012-11-12 17:16:31 +01:00
Florent
3b26a7a6b5 Rename last_gauge_measure to last_censor_measure 2012-11-12 17:16:31 +01:00
Florent
ab778ee5a1 Add a new field 2012-11-12 17:16:31 +01:00
Florent
f63c412b2a Change ICapWaterLevel to be more generic
1) Rename it to ICapGauge
2) One gauge can have more than one sensor (a flow and
   a level for a river, or temperature and humidity for
   a wetter station)
3) Add/remove/rename fields to be more general
2012-11-12 17:16:30 +01:00
Laurent Bachelier
c728dfa774 Declare fields to avoid warnings
Also call the init of CapBaseObject. This should have been done
previously, though the usage of id=None isn't ideal. Maybe it should be
split_path.
2012-11-08 11:51:51 +01:00
Florent
5809f1112a Rename iter_history of ICapBill to iter_bills_history 2012-10-31 14:41:29 +01:00
Florent
8091d9042a Add "reason" field to Transfer 2012-09-27 13:14:03 +02:00
Florent
681b83e4b3 Add balance command to leclercmobile 2012-08-29 16:52:05 +02:00
Florent
f6c212ca72 Add a new command for ICapBill
Useful for pre-paid subscription
2012-08-29 16:52:05 +02:00
Arno Renevier
bfe39958bd allow wetboob to display temperatures either on celsius or on fahrenheit
Close #843
2012-05-10 15:13:34 +02:00
Romain Bignon
6f46c41743 do not fail during fullobj() if the object is not supported by backend 2012-04-28 16:38:55 +02:00
Florent
40de9b2d00 Fix indentation 2012-04-26 12:14:47 +02:00
Romain Bignon
798c51daf9 do not include 'id' in fields if it was removed (-s) 2012-04-26 12:12:55 +02:00
Romain Bignon
aea269e9f6 create UserError exception
Modules can raise this exception when they want to print errors to user
2012-04-25 13:43:52 +02:00
Romain Bignon
5098b3f458 print a warning when a module adds an attribute to a CapBaseObject not prefixed with a _ 2012-04-21 22:38:48 +02:00
Romain Bignon
bccb4d0d03 fix copyright 2012-04-17 22:59:36 +02:00
lucien
657e2213ac common language interface and wordreference backend
Conflicts:

	modules/wordreference/pages.py
	weboob/applications/translaboob/translaboob.py
2012-04-03 22:52:40 +02:00
Romain Bignon
efb18d9dce add a method copy() 2012-04-03 22:40:02 +02:00
Romain Bignon
a8166a4719 several fixes in the new ICapTranslate capability, module and application 2012-04-01 19:32:05 +02:00
lucien
7c573b47a6 * translaboob is a weboob application for automatic translation
* new capability is defined, ICapTranslate
* googletranslate is a backend for the translaboob application
2012-04-01 18:46:13 +02:00
Romain Bignon
b157e92d5b use decimal.Decimal instead of float to store amounts of money 2012-03-29 16:31:18 +02:00
Laurent Bachelier
3b2bafdf12 Centralize "empty" comparisons
And always use "is" instead of "==".
2012-03-27 12:14:37 +02:00
Romain Bignon
cedbc3ae77 check types of compared objects in __eq__() operators 2012-03-27 11:55:24 +02:00
Romain Bignon
7201d81d98 do not implicitly convert strings to dates in DateField 2012-03-27 11:54:54 +02:00
Laurent Bachelier
331b580fb8 Warn when implicit conversions happen
To display them, you can use the python -W argument
or the PYTHONWARNINGS environment variable.
Maybe debug mode should display them.
2012-03-26 23:34:23 +02:00
Romain Bignon
8f0e17ee16 add ICapPriceComparison 2012-03-26 23:00:59 +02:00
Romain Bignon
4ea7872ba4 fix setting None, NotLoaded and NotAvailable values on fields 2012-03-26 22:56:10 +02:00
Romain Bignon
9f86437ea1 do not check anymore if all CapBaseObject have docstrings 2012-03-26 14:41:24 +02:00
Romain Bignon
c6a141595c change way to describe fields of CapBaseObject, and lot of documentation 2012-03-26 14:35:54 +02:00
Laurent Bachelier
ba5949cd22 Remove nb_unread/nb_messages in CapMessages
Most backends don't set it nb_messages and no application used it.
No backends set nb_unread and only one application tried to use it.

This should help avoid useless fillobj() calls in some cases.

fixes #827
2012-03-23 07:04:42 +01:00
Laurent Bachelier
79724c90f5 Remove "thread" argument in iter_unread_messages
It is unused, and no backend implemented it — so it was wrong to have it
in the function signature.
It also does not seem very helpful, we have get_threads() if we want to
do something advanced with treads.

fixes #825
2012-03-23 07:04:40 +01:00
Romain Bignon
e6d5fd019f add a field 'rdate' to store date of payment 2012-03-22 16:33:05 +01:00
Laurent Bachelier
e958c229e6 Move the "empty search for latest" to collections
There is now a "latest" collection (or "latest_nsfw").
The feature didn't look much used, since it didn't work on many
backends.
Using collections will make it easy to support other things
like most viewed, featured, etc.
As a bonus, I added tests for every backend with the feature.
2012-03-16 03:34:22 +01:00
Florent Fourcot
65251c4ceb Display renew confirmation/errors 2012-03-16 00:49:58 +01:00
Florent Fourcot
bdcc5db8bb Add "renew" in ICapBook and in boobooks 2012-03-16 00:49:54 +01:00
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