-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REF] core: Remove psycogreen dependency
Purpose: The psycogreen module is unmaintained. Last source update was in 2015 and last pypi package was in 2012. Odoo only use a small part of the psycogreen module that could be written directly in the odoo code. This commit reproduce the small function from psycogreen used in ODoo and remove all depencies from it. Also the copyright and license are honored and the documentation is updated accordingly. pypi pckage: https://pypi.python.org/pypi/psycogreen bitbucket repos: https://bitbucket.org/dvarrazzo/psycogreen/
- Loading branch information
Showing
8 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -223,6 +223,36 @@ Files: addons/web/static/lib/fontawesome/css/font-awesome.css | |
Copyright: Font Awesome by Dave Gandy - http://fontawesome.io | ||
License: MIT | ||
|
||
Files: odoo/__init__.py | ||
Copyright: Copyright (C) 2010-2012 Daniele Varrazzo <[email protected]> | ||
License: | ||
Copyright (c) 2010-2012, Daniele Varrazzo <[email protected]> | ||
All rights reserved. | ||
. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
. | ||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
* The name of Daniele Varrazzo may not be used to endorse or promote | ||
products derived from this software without specific prior written | ||
permission. | ||
. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | ||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
Comment: This license only applies to the function 'gevent_wait_callback' | ||
|
||
Files: addons/web/static/lib/fontawesome/fonts/* | ||
Copyright: Font Awesome by Dave Gandy - http://fontawesome.io | ||
License: OFL-1.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,27 @@ | |
if len(sys.argv) > 1 and sys.argv[1] == 'gevent': | ||
sys.argv.remove('gevent') | ||
import gevent.monkey | ||
import psycopg2 | ||
from gevent.socket import wait_read, wait_write | ||
gevent.monkey.patch_all() | ||
import psycogreen.gevent | ||
psycogreen.gevent.patch_psycopg() | ||
|
||
def gevent_wait_callback(conn, timeout=None): | ||
"""A wait callback useful to allow gevent to work with Psycopg.""" | ||
# Copyright (C) 2010-2012 Daniele Varrazzo <[email protected]> | ||
# This function is borrowed from psycogreen module which is licensed | ||
# under the BSD license (see in odoo/debian/copyright) | ||
while 1: | ||
state = conn.poll() | ||
if state == psycopg2.extensions.POLL_OK: | ||
break | ||
elif state == psycopg2.extensions.POLL_READ: | ||
wait_read(conn.fileno(), timeout=timeout) | ||
elif state == psycopg2.extensions.POLL_WRITE: | ||
wait_write(conn.fileno(), timeout=timeout) | ||
else: | ||
raise psycopg2.OperationalError( | ||
"Bad result from poll: %r" % state) | ||
psycopg2.extensions.set_wait_callback(gevent_wait_callback) | ||
evented = True | ||
|
||
# Is the server running in prefork mode (e.g. behind Gunicorn). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters