Commit graph

47 commits

Author SHA1 Message Date
Romain Bignon
6fcac89dd5 first step in python3 support 2014-05-17 14:27:55 +02:00
Florent
f6ee441d08 Fix documentation of get_currency 2014-04-02 10:55:45 +02:00
Florent
74b99c4a8d Filters on kwargs for find_object 2014-04-02 10:46:31 +02:00
Florent
6591785a10 s/find_id_list/find_object/ 2014-04-02 10:31:00 +02:00
Florent
080c4aff81 Introduce find_id_list
And code simplification in backends/browsers
2014-04-01 17:40:38 +02:00
Romain Bignon
03ce941ccf Revert "Rewrite the empty function according to the new NotLoaded"
This reverts commit 22606d961f.
2014-03-19 09:16:05 +01:00
Romain Bignon
892b3634a3 copy of NotLoaded and NotAvailable returns the same object 2014-03-19 09:15:38 +01:00
Florent
22606d961f Rewrite the empty function according to the new NotLoaded
and the new NotAvailableType...
2014-03-18 12:02:26 +01:00
Florent
fc6f7d8c21 NotAvailable and NotLoaded should not be callable 2014-03-18 11:51:02 +01:00
Romain Bignon
8d7f613f59 do not require an id, because of ItemElement which constructs objects without arguments 2014-03-10 13:11:07 +01:00
Romain Bignon
6099560b8c change currencies integer constants to ISO code strings 2014-02-16 19:48:17 +01:00
Florent
4d5b84a2a8 Move Currency from ICapBank to ICapBase 2013-07-30 10:35:25 +02:00
Romain Bignon
59dea09c8a fix problem with strftime on date.year<1900 2013-03-30 12:30:33 +01:00
Laurent Bachelier
75b428af07 Code style fixes
autopep8 -ir -j2 --select=W601,W602 .
Diff checked manually.
2013-03-16 00:52:43 +01:00
Julien Veyssier
3492dbb9d6 imdb and cineoob in progress 2013-03-13 01:16:35 +01:00
Julien Veyssier
af8a3e5bd5 new cap cinema 2013-03-13 01:16:34 +01:00
Laurent Bachelier
a6fbcbaec7 Reconcile the two previous commits (json/to_dict)
Also fix some to_dict move things that were incomplete.
And some PEP8 fixes.

closes #1060
closes #1061
2013-03-09 15:14:17 +01:00
Julien Hebert
1b47455225 refs #1060 : move to_dict to base.py 2013-03-09 14:57:09 +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
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)