Commit Graph
52 Commits
Author SHA1 Message Date
Cédric Krier c6503c1a93 Add cached_property in tools
issue9277
review299951002
2020-06-17 00:33:30 +02:00
Cédric Krier d7ed5f91f5 Fix flake8 errors and warnings
We add the flake8 configuration used so we ensure everyone uses the same.
We remove the usage of __all__ for non public API.
When possible, we rationalize the class name according to its __name__ and module.

issue9082
review297061002
2020-03-01 12:33:54 +01:00
Cédric Krier 03b07a60e9 Use more appropriate HTTP status for Tryton exceptions
issue8929
review252781002
2020-01-20 22:25:12 +01:00
Cédric Krier 922c420fae Return bad request for Tryton exception instead of internal error
Those exceptions are expected behavior so it is the fault of the client, not
the server.

issue8768
review276221002
2019-11-17 17:36:07 +01:00
Cédric Krier d2a461390a Remove support for Python 2.7
issue7497
review53261002
2018-06-26 19:11:19 +02:00
Cédric Krier e7ff9ee619 Use compact separators to dump json
issue6373
review33991002
2017-03-23 22:51:36 +01:00
Cédric Krier c0aa69fa23 Make wsgi app returns Internal Server Error on exception
If no protocol convert the data into a Response and if the data is an exception
it should be returned as an Internal Server Error instead of a succeed
response.
The exception can be used as description for the Internal Server Error.

issue6201
review31951002
2017-01-29 01:11:57 +01:00
Cédric Krier f9c0457416 Remove support for simplejson
On Python 3, simplejson has a different behaviour than the stdlib json,
especially for dumping bytes.

issue6010
review33601002
2016-11-05 19:54:12 +01:00
Cédric Krier 965d010dc9 Add user application
issue5782
review28641002
2016-09-27 11:56:19 +02:00
Cédric Krier 16f0e84f25 Format the exception inside the try/except
Outside the try/except sys.exc_info returns None values, so we must format the
traceback inside the try/except.

issue5647
review23221002
2016-06-18 12:04:45 +02:00
Cédric Krier b08b37423d Decode data before json loads
issue5536
review23041002
2016-05-10 10:19:22 +02:00
Cédric Krier 8a4ba59b2d Switch to WSGI API
issue4646
review20541003
2016-03-15 16:57:26 +01:00
Cédric Krier 29129855ec Add support for Python 3
issue3211
review7311002
2016-02-07 16:46:16 +01:00
Cédric Krier 5cfde31ed2 Use bytes and bytearray for Binary
issue4637
review11091002
2015-03-16 19:28:34 +01:00
Cédric Krier 0991a552de Add TimeDelta field
And remove float_time widget.

issue4026
review5911002
2015-02-09 22:58:56 +01:00
Cédric Krier c144f8c349 Fix most flake8 errors
review8771002
2014-12-02 12:54:01 +01:00
Cédric Krier e0b995abbe Refactore configuration to allow easy extention
issue3627
review7401002
2014-09-03 23:32:01 +02:00
Cédric Krier 174b2ed218 Fix protocols and add unittest
review12371002
2014-06-07 23:54:44 +02:00
Cédric Krier 66d9aeb29f Fix and add missing registering type for json and xmlrpc
introduced in changeset ec4c234379ab
2014-06-07 01:04:46 +02:00
Nicolas Évrard d83fc99f35 Allow to register different type for json/xmlrpc encoding/decoding
issue3839
review5021003
2014-06-06 12:57:27 +02:00
Cédric Krier 80fc6aff30 Use copy of handlers set to prevent changed size during iteration 2014-04-04 23:38:21 +02:00
Cédric Krier 68127768cf Remove old backward Python <= 2.6 compatibility code 2014-04-04 23:34:56 +02:00
Cédric Krier 64421ff64f Manage microseconds in JSON-RPC and XML-RPC
review3551002
2014-03-15 10:36:20 +01:00
Cédric Krier bc6acd08ee Drop support of Python 2.6
review2691002
2014-01-31 00:02:03 +01:00
Cédric Krier 9ed421dc28 Add svg mimetype to SimpleJSONRPCRequestHandler
review1062002
2013-09-17 10:18:24 +02:00
Cédric Krier 1a362c3879 Remove dependency to pyOpenSSL
review598006
2012-12-13 19:04:52 +01:00
Cédric Krier dc10b34453 Activate TCP_NODELAY for jsonrpc 2012-07-28 18:12:08 +02:00
Cédric Krier 5c9ea961ec Add missing shutdown_request on TCPServer for Python <= 2.6
issue2606
review374001
2012-05-19 15:30:38 +02:00
Cédric Krier ee3be37a36 Fix pep8 and pyflakes 2012-04-01 23:08:15 +02:00
Cédric Krier 1b0a713dad New autoreload that restarts the server instead of reloading modules
issue2417
review283001
2012-03-12 22:27:59 +01:00
Cédric Krier ef6351983c Better management of redirect
Some web browsers don't support correctly empty content.
Others don't follow no-HTTP protocol in location header so we use
http-equiv="Refresh".
And finally show a simple link for very old web browsers.

review233001
2012-02-08 16:14:25 +01:00
Cédric Krier e348c49312 Add support of fields.Time
issue2313
review231006
2012-02-07 16:11:22 +01:00
Cédric Krier 54e3189fb6 Keep traceback as str as we don't know the encoding
issue2302
review225001
2012-01-17 13:54:08 +01:00
Cédric Krier 4bd45954fb Activate SO_KEEPALIVE on socket
review221002
2012-01-17 13:51:08 +01:00
Cédric Krier f31a96bd37 Return tryton URL for similar GET queries on jsonrpc interface
review208004
2012-01-17 13:49:50 +01:00
Nicolas Évrard 0a471486e0 correct pyflake errors
review164003
2011-11-02 15:49:38 +01:00
Cédric Krier 66c05f49a7 Use simplejson if possible as it is faster
review146001
2011-10-14 09:56:05 +02:00
Nicolas Évrard c41afcf47b remove unused prints 2011-10-04 14:01:58 +02:00
Nicolas Évrard c6174a0b61 replace .csv file by .po file for translations
review125002
issue1163
2011-10-04 13:03:06 +02:00
Cédric Krier fefd67c3a5 Improve Binary fields
* Support size format in context for Binary fields
* Use buffer for Binary fields
* No more store Binary fields in base64

review74006
2011-09-17 14:43:05 +02:00
Cédric Krier 1a84c04adf Rational exceptions
review94001
2011-09-05 20:30:26 +02:00
Cédric Krier d5efbc62ad Drop NetRPC and activate JSON-RPC by default 2011-08-06 14:31:24 +02:00
Cédric Krier a370592430 Remove socket timeout code for Python < 2.6 2011-07-16 20:17:30 +02:00
Cédric Krier 1ce3832259 Remove version_info test 2011-07-12 23:54:14 +02:00
Cédric Krier c370a1fdc7 Handle timeout in SocketServer for Python < 2.6 for issue1731 2010-10-19 22:32:37 +02:00
Phillip Heller 91184b1173 Factored out common daemon code from services to new trytond.protocols.com
Suppress Errno 57 when attempting to close an already shut socket, fixes issue1624
Revert from join() on enumerated threads to join() on individual service threadsto preserve debugging environments
2010-10-06 16:53:00 -04:00
Cédric Krier 483afed26a Catch only Exception according to PEP 352 2010-07-08 19:53:39 +02:00
Cédric Krier c77ce123c5 Fix jsonrpc strip of "sao/" for issue1555 2010-05-04 23:33:08 +02:00
Cédric Krier 0415e46c73 Don't allow to use float in Numeric fields
The goal is to prevent to introduce float errors in Numeric fields.
There is a trick for external protocols like XML-RPC and JSON-RPC where the
string representation is stored in the Float object and will be used to
convert it into Decimal.
2010-03-12 17:41:07 +01:00
Cédric Krier b5fb4d1ef3 Refactoring by validation with pylint 2010-02-18 18:50:35 +01:00