xavinsky has proposed merging 
lp:~xavinsky/openobject-client/trunk-bug-872925-xavinsky into 
lp:openobject-client.

Requested reviews:
  OpenERP sa GTK client R&D (openerp-dev-gtk)

For more details, see:
https://code.launchpad.net/~xavinsky/openobject-client/trunk-bug-872925-xavinsky/+merge/79146

fix the bug #872925

Install on linux (debian with ou wothout virtualenv)
after the
python setup.py install
when I use openerp-client command :
<pathbin>/bin/openerp-client: 2: cd: can't cd to 
<pathlib>/lib/python2.7/site-packages/openerp-client

because the path miss the egg folder :
<pathlib>/lib/python2.7/site-packages/openerp_client-6.1dev-py2.7.egg/openerp-client

Solution : calculate the egg path and add it.

-- 
https://code.launchpad.net/~xavinsky/openobject-client/trunk-bug-872925-xavinsky/+merge/79146
Your team OpenERP sa GTK client R&D is requested to review the proposed merge 
of lp:~xavinsky/openobject-client/trunk-bug-872925-xavinsky into 
lp:openobject-client.
=== modified file 'mydistutils.py'
--- mydistutils.py	2011-05-06 15:22:17 +0000
+++ mydistutils.py	2011-10-12 15:53:12 +0000
@@ -58,6 +58,7 @@
 from setuptools.command.install import install
 from distutils.command.install_data import install_data
 from distutils.dep_util import newer
+from distutils.sysconfig import get_python_version
 import distutils.core
 
 from distutils.errors import DistutilsSetupError
@@ -90,11 +91,16 @@
             opj = os.path.join
             # Peek into "install" command to find out where it is going to install to
             inst_cmd = self.get_finalized_command('install')
+            egg_name = "%s-%s-py%s.egg" % (inst_cmd.distribution.get_name().replace('-','_'), 
+                                           inst_cmd.distribution.get_version(), 
+                                           get_python_version())
             if inst_cmd:
                 # Note: we user the "purelib" because we don't ship binary
                 # executables. If we ever compile things into execs, we shall 
                 # use "platlib"
-                openerp_site_packages = opj(inst_cmd.install_purelib,'openerp-client')
+                openerp_site_packages = opj(inst_cmd.install_purelib,
+                                            egg_name,
+                                            'openerp-client')
                 if inst_cmd.root and openerp_site_packages.startswith(inst_cmd.root):
                     # trick: when we install relative to root, we mostly mean to
                     # temporary put the files there, and then move back to the
@@ -107,7 +113,12 @@
            
             else:
                 # Hard-code the Linux /usr/lib/pythonX.Y/... path
-                openerp_site_packages = opj('/usr', 'lib', 'python%s' % py_short_version, 'site-packages', 'openerp-client')
+                openerp_site_packages = opj('/usr',
+                                            'lib',
+                                            'python%s' % py_short_version,
+                                            'site-packages',
+                                            egg_name,
+                                            'openerp-client')
             start_script = "#!/bin/sh\ncd %s\nexec %s ./openerp-client.py $@\n" % (openerp_site_packages, sys.executable)
             # write script
             f = open('openerp-client', 'w')

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to