Skip to content

Commit

Permalink
[REF] server: remove the openerp-gevent file
Browse files Browse the repository at this point in the history
* use a special arg in odoo.py
* note that the previous implementation was relying on the fact that
  the openerp-gevent file was located in the same directory than the
  odoo.py file. This was no longer true since rev a0eb172
  This commit brings back this behavior.
  • Loading branch information
sle-odoo authored and KangOl committed Sep 7, 2016
1 parent e0784ee commit 76c7041
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
6 changes: 6 additions & 0 deletions odoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ def main():
elif len(sys.argv) == 2 and sys.argv[1] in cmds:
cmds[sys.argv[1]]()
else:
if sys.argv[1] == 'gevent':
sys.argv.remove('gevent')
import gevent.monkey
gevent.monkey.patch_all()
import psycogreen.gevent
psycogreen.gevent.patch_psycopg()
import odoo
odoo.cli.main()

Expand Down
5 changes: 2 additions & 3 deletions odoo/service/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,8 @@ def worker_spawn(self, klass, workers_registry):

def long_polling_spawn(self):
nargs = stripped_sys_argv()
cmd = nargs[0]
cmd = os.path.join(os.path.dirname(cmd), "openerp-gevent")
nargs[0] = cmd
cmd = os.path.join(os.path.dirname(nargs[0]), "odoo.py")
nargs = [cmd, 'gevent'] + nargs[1:]
popen = subprocess.Popen([sys.executable] + nargs)
self.long_polling_pid = popen.pid

Expand Down
11 changes: 0 additions & 11 deletions openerp-gevent

This file was deleted.

3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def py2exe_options():
return {
'console': [
{'script': 'odoo.py'},
{'script': 'openerp-gevent'},
{'script': 'openerp-server', 'icon_resources': [
(1, join('setup', 'win32', 'static', 'pixmaps', 'openerp-icon.ico'))
]},
Expand Down Expand Up @@ -130,7 +129,7 @@ def py2exe_options():
author_email=author_email,
classifiers=filter(None, classifiers.split('\n')),
license=license,
scripts=['openerp-server', 'openerp-gevent', 'odoo.py'],
scripts=['openerp-server', 'odoo.py'],
packages=find_packages(),
package_dir={'%s' % lib_name: 'openerp'},
include_package_data=True,
Expand Down

0 comments on commit 76c7041

Please sign in to comment.