[REF] server: remove the openerp-gevent file
* 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 a0eb172cab
This commit brings back this behavior.
This commit is contained in:
committed by
Christophe Simonis
parent
e0784ee0b7
commit
76c7041c5b
@@ -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()
|
||||
|
||||
|
||||
@@ -443,9 +443,8 @@ class PreforkServer(CommonServer):
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import gevent.monkey
|
||||
gevent.monkey.patch_all()
|
||||
import psycogreen.gevent
|
||||
psycogreen.gevent.patch_psycopg()
|
||||
|
||||
import odoo
|
||||
|
||||
if __name__ == "__main__":
|
||||
odoo.cli.main()
|
||||
@@ -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'))
|
||||
]},
|
||||
@@ -130,7 +129,7 @@ setup(
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user