virtualenv/res/lib/lib_create_env.py
author ymh <ymh.work@gmail.com>
Sat, 15 Oct 2011 02:15:24 +0200
changeset 4 238f3cd543f2
parent 1 40d6b5e3dcd7
child 12 22257618a7c2
permissions -rwxr-xr-x
move file to correct locations
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
     1
import sys
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
     2
import os
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
     3
import os.path
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
     4
import shutil
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
     5
import tarfile
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
     6
import zipfile
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
     7
import urllib
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
     8
import platform
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
     9
import patch
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    10
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    11
join = os.path.join
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    12
system_str = platform.system()
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    13
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    14
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    15
URLS = {
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    16
    #'': {'setup': '', 'url':'', 'local':''},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    17
    'DISTRIBUTE': {'setup': 'distribute', 'url':'http://pypi.python.org/packages/source/d/distribute/distribute-0.6.14.tar.gz', 'local':"distribute-0.6.14.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    18
    'DJANGO': {'setup': 'django', 'url': 'http://www.djangoproject.com/download/1.3/tarball/', 'local':"Django-1.3.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    19
    'DJANGO-EXTENSIONS': { 'setup': 'django-extensions', 'url':'https://github.com/django-extensions/django-extensions/tarball/0.6', 'local':"django-extensions-0.6.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    20
    'DJANGO-REGISTRATION': { 'setup': 'django-registration', 'url':'http://bitbucket.org/ubernostrum/django-registration/get/tip.tar.gz', 'local':"django-registration.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    21
    'DJANGO-TAGGING': { 'setup': 'django-tagging', 'url':'http://django-tagging.googlecode.com/files/django-tagging-0.3.1.tar.gz', 'local':"django-tagging-0.3.1.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    22
    'DJANGO-PISTON': { 'setup': 'django-piston', 'url':"django-piston-0.2.2-modified.tar.gz", 'local':"django-piston-0.2.2-modified.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    23
    'OAUTH2': { 'setup': 'python-oauth2', 'url':"http://pypi.python.org/packages/source/o/oauth2/oauth2-1.5.168.tar.gz", 'local':"oauth2-1.5.167.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    24
    'HTTPLIB2': { 'setup': 'python-httplib2', 'url':'http://httplib2.googlecode.com/files/httplib2-0.6.0.tar.gz', 'local':"httplib2-0.6.0.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    25
    'DJANGO-OAUTH-PLUS': { 'setup': 'django-oauth-plus', 'url':'http://bitbucket.org/david/django-oauth-plus/get/f314f018e473.gz', 'local':"django-oauth-plus.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    26
    'MYSQL': { 'setup': 'mysql-python', 'url': 'http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz/download', 'local':"MySQL-python-1.2.3.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    27
    'SETUPTOOLS-HG': { 'setup':'mercurial_hg', 'url':'http://pypi.python.org/packages/source/s/setuptools_hg/setuptools_hg-0.2.tar.gz', 'local':"setuptools_hg-0.2.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    28
    'MERCURIAL': {'setup':'mercurial', 'url':'http://pypi.python.org/packages/source/d/mercurial/mercurial-1.7.5.tar.gz', 'local':"mercurial-1.7.5.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    29
    'OPENID': {'setup':'openid', 'url':'http://pypi.python.org/packages/source/p/python-openid/python-openid-2.2.5.tar.gz', 'local':"python-openid-2.2.5.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    30
    'DJANGO_OPENID_CONSUMER': {'setup':'django_openid_consumer', 'url':'http://pypi.python.org/packages/source/d/django-openid-consumer/django-openid-consumer-0.1.1.tar.gz', 'local':"django-openid-consumer-0.1.1.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    31
    'SOCIAL_AUTH': {'setup':'social_auth', 'url':'https://github.com/omab/django-social-auth/tarball/v0.3.10', 'local':"omab-django-social-auth-v0.3.10-modified.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    32
    'SOUTH': { 'setup': 'South', 'url':'http://www.aeracode.org/releases/south/south-0.7.3.tar.gz', 'local':"south-0.7.3.tar.gz"},
4
238f3cd543f2 move file to correct locations
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    33
    'LDT': { 'setup': 'ldt', 'url':'ldt-0.19.tar.gz', 'local':"ldt-0.19.tar.gz"},
1
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    34
}
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    35
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    36
if system_str == 'Windows':
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    37
    URLS.update({
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    38
        'PSYCOPG2': {'setup': 'psycopg2','url': 'psycopg2-2.0.14.win32-py2.6-pg8.4.3-release.zip', 'local':"psycopg2-2.0.14.win32-py2.6-pg8.4.3-release.zip"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    39
        'JCC': {'setup': 'jcc', 'url': 'http://pylucene-win32-binary.googlecode.com/files/JCC-2.6-py2.6-win32.egg', 'local':"JCC-2.6-py2.6-win32.egg"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    40
        'PYLUCENE': {'setup': 'pylucene', 'url': 'http://pylucene-win32-binary.googlecode.com/files/lucene-3.0.2-py2.6-win32.egg', 'local':"lucene-3.0.2-py2.6-win32.egg"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    41
        'PIL': {'setup': 'pil', 'url': 'http://effbot.org/media/downloads/PIL-1.1.7.win32-py2.6.exe', 'local':"PIL-1.1.7.win32-py2.6.exe"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    42
        'LXML': {'setup': 'lxml', 'url': 'http://pypi.python.org/packages/2.6/l/lxml/lxml-2.2.2-py2.6-win32.egg', 'local':"lxml-2.2.2-py2.6-win32.egg"}
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    43
    })
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    44
else:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    45
    URLS.update({
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    46
        'PSYCOPG2': {'setup': 'psycopg2','url': 'http://www.psycopg.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.tar.gz', 'local':"psycopg2-2.4.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    47
        'PYLUCENE': {'setup': 'pylucene', 'url': 'http://apache.crihan.fr/dist//lucene/pylucene/pylucene-3.1.0-1-src.tar.gz', 'local':"pylucene-3.1.0-1-src.tar.gz"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    48
        'PIL': {'setup': 'pil', 'url': 'http://effbot.org/downloads/Imaging-1.1.7.tar.gz', 'local':"Imaging-1.1.7.tar.gz"},
4
238f3cd543f2 move file to correct locations
ymh <ymh.work@gmail.com>
parents: 1
diff changeset
    49
        'LXML': {'setup': 'lxml', 'url':"lxml-2.3.1.tar.bz2", 'local':"lxml-2.3.1.tar.bz2"}
1
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    50
    })
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    51
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    52
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    53
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    54
class ResourcesEnv(object):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    55
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    56
    def __init__(self, src_base, urls, normal_installs):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    57
        self.src_base = src_base
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    58
        self.URLS = {}
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    59
        self.__init_url(urls)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    60
        self.NORMAL_INSTALL = normal_installs
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    61
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    62
    def get_src_base_path(self, fpath):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    63
        return os.path.abspath(os.path.join(self.src_base, fpath)).replace("\\","/")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    64
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    65
    def __add_package_def(self, key, setup, url, local):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    66
        self.URLS[key] = {'setup':setup, 'url':url, 'local':self.get_src_base_path(local)}
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    67
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    68
    def __init_url(self, urls):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    69
        for key, url_dict in urls.items():
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    70
            url = url_dict['url']
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    71
            if not url.startswith("http://"):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    72
                url = self.get_src_base_path(url)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    73
            self.__add_package_def(key, url_dict["setup"], url, url_dict["local"])
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    74
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    75
def ensure_dir(dir, logger):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    76
    if not os.path.exists(dir):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    77
        logger.notify('Creating directory %s' % dir)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    78
        os.makedirs(dir)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    79
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    80
def extend_parser(parser):    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    81
    parser.add_option(
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    82
        '--index-url',
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    83
        metavar='INDEX_URL',
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    84
        dest='index_url',
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    85
        default='http://pypi.python.org/simple/',
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    86
        help='base URL of Python Package Index')
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    87
    parser.add_option(
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    88
        '--type-install',
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    89
        metavar='type_install',
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    90
        dest='type_install',
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    91
        default='local',
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    92
        help='type install : local, url, setup')
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    93
    parser.add_option(
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    94
        '--ignore-packages',
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    95
        metavar='ignore_packages',
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    96
        dest='ignore_packages',
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    97
        default=None,
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    98
        help='list of comma separated keys for package to ignore')
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    99
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   100
def adjust_options(options, args):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   101
    pass
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   102
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   103
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   104
def install_pylucene(option_str, extra_env, res_source_key, home_dir, lib_dir, tmp_dir, src_dir, res_env, logger, call_subprocess, filter_python_develop):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   105
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   106
    logger.notify("Get Pylucene from %s " % res_env.URLS['PYLUCENE'][res_source_key])
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   107
    pylucene_src = os.path.join(src_dir,"pylucene.tar.gz")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   108
    if res_source_key == 'local':
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   109
        shutil.copy(res_env.URLS['PYLUCENE'][res_source_key], pylucene_src)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   110
    else:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   111
        urllib.urlretrieve(res_env.URLS['PYLUCENE'][res_source_key], pylucene_src)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   112
    tf = tarfile.open(pylucene_src,'r:gz')
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   113
    pylucene_base_path = os.path.join(src_dir,"pylucene") 
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   114
    logger.notify("Extract Pylucene to %s " % pylucene_base_path)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   115
    tf.extractall(pylucene_base_path)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   116
    tf.close()
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   117
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   118
    pylucene_src_path = os.path.join(pylucene_base_path, os.listdir(pylucene_base_path)[0])
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   119
    jcc_src_path = os.path.abspath(os.path.join(pylucene_src_path,"jcc"))
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   120
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   121
    #install jcc
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   122
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   123
    #patch for linux
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   124
    if system_str == 'Linux' :
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   125
        olddir = os.getcwd()
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   126
        setuptools_path = os.path.join(lib_dir, 'site-packages', 'setuptools')
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   127
        if os.path.exists(setuptools_path) and os.path.isdir(setuptools_path):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   128
            patch_dest_path = os.path.join(lib_dir, 'site-packages')
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   129
        else:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   130
            patch_dest_path = os.path.join(lib_dir,'site-packages','setuptools-0.6c11-py%s.%s.egg' % (sys.version_info[0], sys.version_info[1]))
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   131
            if os.path.isfile(patch_dest_path):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   132
                # must unzip egg
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   133
                # rename file and etract all
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   134
                shutil.move(patch_dest_path, patch_dest_path + ".zip")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   135
                zf = zipfile.ZipFile(patch_dest_path + ".zip",'r')
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   136
                zf.extractall(patch_dest_path)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   137
                os.remove(patch_dest_path + ".zip")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   138
        logger.notify("Patch jcc : %s " % (patch_dest_path))
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   139
        os.chdir(patch_dest_path)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   140
        p = patch.fromfile(os.path.join(jcc_src_path,"jcc","patches","patch.43.0.6c11"))
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   141
        p.apply()
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   142
        os.chdir(olddir)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   143
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   144
    logger.notify("Install jcc")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   145
    call_subprocess([os.path.abspath(os.path.join(home_dir, 'bin', 'python')), 'setup.py', 'install'],
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   146
                    cwd=jcc_src_path,
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   147
                    filter_stdout=filter_python_develop,
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   148
                    show_stdout=True)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   149
    #install pylucene
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   150
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   151
    logger.notify("Install pylucene")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   152
    #modify makefile
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   153
    makefile_path = os.path.join(pylucene_src_path,"Makefile")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   154
    logger.notify("Modify makefile %s " % makefile_path)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   155
    shutil.move( makefile_path, makefile_path+"~" )
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   156
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   157
    destination= open( makefile_path, "w" )
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   158
    source= open( makefile_path+"~", "r" )
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   159
    destination.write("PREFIX_PYTHON="+os.path.abspath(home_dir)+"\n")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   160
    destination.write("ANT=ant\n")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   161
    destination.write("PYTHON=$(PREFIX_PYTHON)/bin/python\n")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   162
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   163
    if system_str == "Darwin":
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   164
        if sys.version_info >= (2,6):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   165
            destination.write("JCC=$(PYTHON) -m jcc.__main__ --shared --arch x86_64 --arch i386\n")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   166
        else:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   167
            destination.write("JCC=$(PYTHON) -m jcc --shared --arch x86_64 --arch i386\n")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   168
        destination.write("NUM_FILES=2\n")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   169
    elif system_str == "Windows":
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   170
        destination.write("JCC=$(PYTHON) -m jcc.__main__ --shared --arch x86_64 --arch i386\n")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   171
        destination.write("NUM_FILES=2\n")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   172
    else:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   173
        if sys.version_info >= (2,6) and sys.version_info <= (2,7):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   174
            destination.write("JCC=$(PYTHON) -m jcc.__main__ --shared\n")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   175
        else:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   176
            destination.write("JCC=$(PYTHON) -m jcc --shared\n")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   177
        destination.write("NUM_FILES=2\n")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   178
    for line in source:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   179
        destination.write( line )
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   180
    source.close()
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   181
    destination.close()
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   182
    os.remove(makefile_path+"~" )
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   183
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   184
    logger.notify("pylucene make")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   185
    call_subprocess(['make'],
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   186
                    cwd=os.path.abspath(pylucene_src_path),
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   187
                    filter_stdout=filter_python_develop,
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   188
                    show_stdout=True)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   189
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   190
    logger.notify("pylucene make install")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   191
    call_subprocess(['make', 'install'],
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   192
                    cwd=os.path.abspath(pylucene_src_path),
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   193
                    filter_stdout=filter_python_develop,
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   194
                    show_stdout=True)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   195
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   196
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   197
def install_psycopg2(option_str, extra_env, res_source_key, home_dir, lib_dir, tmp_dir, src_dir, res_env, logger, call_subprocess, filter_python_develop):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   198
    psycopg2_src = os.path.join(src_dir,"psycopg2.zip")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   199
    shutil.copy(res_env.URLS['PSYCOPG2'][res_source_key], psycopg2_src)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   200
    #extract psycopg2
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   201
    zf = zipfile.ZipFile(psycopg2_src)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   202
    psycopg2_base_path = os.path.join(src_dir,"psycopg2")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   203
    zf.extractall(psycopg2_base_path)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   204
    zf.close()
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   205
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   206
    psycopg2_src_path = os.path.join(psycopg2_base_path, os.listdir(psycopg2_base_path)[0])
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   207
    shutil.copytree(os.path.join(psycopg2_src_path, 'psycopg2'), os.path.abspath(os.path.join(home_dir, 'Lib/site-packages', 'psycopg2')))
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   208
    shutil.copy(os.path.join(psycopg2_src_path, 'psycopg2-2.0.14-py2.6.egg-info'), os.path.abspath(os.path.join(home_dir, 'Lib/site-packages', 'site-packages')))
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   209
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   210
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   211
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   212
def lib_generate_install_methods(path_locations, src_base, Logger, call_subprocess, normal_installs, urls=None):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   213
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   214
    all_urls = URLS.copy()
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   215
    if urls is not None:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   216
        all_urls.update(urls)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   217
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   218
    res_env = ResourcesEnv(src_base, all_urls, normal_installs)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   219
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   220
    def filter_python_develop(line):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   221
        if not line.strip():
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   222
            return Logger.DEBUG
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   223
        for prefix in ['Searching for', 'Reading ', 'Best match: ', 'Processing ',
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   224
                       'Moving ', 'Adding ', 'running ', 'writing ', 'Creating ',
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   225
                       'creating ', 'Copying ']:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   226
            if line.startswith(prefix):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   227
                return Logger.DEBUG
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   228
        return Logger.NOTIFY
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   229
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   230
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   231
    def normal_install(key, method, option_str, extra_env, res_source_key, home_dir, tmp_dir, res_env, logger, call_subprocess):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   232
        logger.notify("Install %s from %s with %s" % (key,res_env.URLS[key][res_source_key],method))
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   233
        if method == 'pip':
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   234
            if sys.platform == 'win32':
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   235
                args = [os.path.abspath(os.path.join(home_dir, 'Scripts', 'pip')), 'install', '-E', os.path.abspath(home_dir), res_env.URLS[key][res_source_key]]
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   236
            else:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   237
                args = [os.path.abspath(os.path.join(home_dir, 'bin', 'pip')), 'install', '-E', os.path.abspath(home_dir), res_env.URLS[key][res_source_key]]
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   238
            if option_str :
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   239
                args.insert(4,option_str)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   240
            call_subprocess(args,
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   241
                    cwd=os.path.abspath(tmp_dir),
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   242
                    filter_stdout=filter_python_develop,
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   243
                    show_stdout=True,
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   244
                    extra_env=extra_env)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   245
        else:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   246
            if sys.platform == 'win32':
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   247
                args = [os.path.abspath(os.path.join(home_dir, 'Scripts', 'easy_install')), res_env.URLS[key][res_source_key]]
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   248
            else:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   249
                args = [os.path.abspath(os.path.join(home_dir, 'bin', 'easy_install')), res_env.URLS[key][res_source_key]]
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   250
            if option_str :
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   251
                args.insert(1,option_str)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   252
            call_subprocess(args,
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   253
                    cwd=os.path.abspath(tmp_dir),
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   254
                    filter_stdout=filter_python_develop,
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   255
                    show_stdout=True,
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   256
                    extra_env=extra_env)            
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   257
 
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   258
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   259
    def after_install(options, home_dir):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   260
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   261
        global logger
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   262
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   263
        verbosity = options.verbose - options.quiet
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   264
        logger = Logger([(Logger.level_for_integer(2-verbosity), sys.stdout)])
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   265
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   266
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   267
        home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   268
        base_dir = os.path.dirname(home_dir)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   269
        src_dir = os.path.join(home_dir, 'src')
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   270
        tmp_dir = os.path.join(home_dir, 'tmp')
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   271
        ensure_dir(src_dir, logger)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   272
        ensure_dir(tmp_dir, logger)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   273
        system_str = platform.system()
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   274
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   275
        res_source_key = options.type_install
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   276
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   277
        ignore_packages = []
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   278
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   279
        if options.ignore_packages :
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   280
            ignore_packages = options.ignore_packages.split(",")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   281
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   282
        logger.indent += 2
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   283
        try:    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   284
            for key, method, option_str, extra_env in res_env.NORMAL_INSTALL:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   285
                if key not in ignore_packages:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   286
                    if callable(method):
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   287
                        method(option_str, extra_env, res_source_key, home_dir, lib_dir, tmp_dir, src_dir, res_env, logger, call_subprocess, filter_python_develop)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   288
                    else:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   289
                        normal_install(key, method, option_str, extra_env, res_source_key, home_dir, tmp_dir, res_env, logger, call_subprocess)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   290
                            
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   291
            logger.notify("Clear source dir")
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   292
            shutil.rmtree(src_dir)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   293
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   294
        finally:
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   295
            logger.indent -= 2
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   296
        script_dir = join(base_dir, bin_dir)
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   297
        logger.notify('Run "%s Package" to install new packages that provide builds'
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   298
                      % join(script_dir, 'easy_install'))
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   299
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   300
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
   301
    return adjust_options, extend_parser, after_install