Commit graph

29 commits

Author SHA1 Message Date
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
Romain Bignon
6f46c41743 do not fail during fullobj() if the object is not supported by backend 2012-04-28 16:38:55 +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
efb18d9dce add a method copy() 2012-04-03 22:40:02 +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
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
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
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
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
Romain Bignon
f6c2edc64f add a 'fullid' property to get 'ID@backend' 2012-02-18 12:27:18 +01:00
Romain Bignon
7e2bb91b3b change license to AGPLv3+ 2011-04-08 12:48:07 +02:00
juke
9fb8b150f2 line too long 2011-02-10 17:15:13 +01:00
Romain Bignon
28e57001bc add a messages refresh button, and better handler of contacts selection 2010-10-30 09:58:52 +02:00
Romain Bignon
bcfa838e86 new method CapBaseObject.add_field()
When you want to add a field to your CapBaseObject derivated class, use
this method to:
- add it in the fields list (order is important)
- set the only possible values types
- default value to NotLoaded if not specified
- possibility to set another value
2010-10-08 13:41:41 +02:00
Romain Bignon
bf81773e8b if FIELDS is not defined, still raise id first 2010-10-08 10:52:41 +02:00
Romain Bignon
c8bb18ea4b FIELDS isn't a field 2010-09-26 23:36:52 +02:00
Christophe Benz
9e2345eeb9 implement select command 2010-09-21 13:10:52 -04:00
Romain Bignon
b354f8d3a7 enhancement of load detection of fields 2010-08-14 21:50:31 +02:00
Romain Bignon
f2871c8811 bool(NotLoaded) and bool(NotAvailable) are False 2010-08-13 21:01:05 +02:00
Christophe Benz
87f34c1961 set not loaded fields to NotAvailable 2010-08-12 18:17:19 +02:00
Romain Bignon
e980e040ba capabilities objets inherit from CapBaseObject (refs #369) 2010-08-12 17:22:04 +02:00
Christophe Benz
ecf8077eb8 add __str__ methods 2010-08-12 16:04:53 +02:00
Christophe Benz
45ffb0fe7d s/ICap/IBaseCap and add constants 2010-08-12 16:04:53 +02:00
Renamed from weboob/capabilities/cap.py (Browse further)