virtualenv/res/lib/lib_create_env.py
author tc
Fri, 30 Sep 2011 16:06:04 +0200
changeset 1 40d6b5e3dcd7
child 4 238f3cd543f2
permissions -rwxr-xr-x
First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
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"},
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    33
}
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
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
    36
    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
    37
        '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
    38
        '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
    39
        '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
    40
        '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
    41
        '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
    42
    })
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
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
    44
    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
    45
        '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
    46
        '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
    47
        'PIL': {'setup': 'pil', 'url': 'http://effbot.org/downloads/Imaging-1.1.7.tar.gz', 'local':"Imaging-1.1.7.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
        'LXML': {'setup': 'lxml', 'url':"lxml-2.3.tar.bz2", 'local':"lxml-2.3.tar.bz2"}
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is not installed in the virtualenv, we have to copy the ldt folder to the site-packages. Otherwise, it works perfectly.
tc
parents:
diff changeset
    49
    })
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
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
    54
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
    56
        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
    57
        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
    58
        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
    59
        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
    60
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
    62
        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
    63
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
    65
        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
    66
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
    68
        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
    69
            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
    70
            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
    71
                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
    72
            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
    73
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
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
    75
    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
    76
        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
    77
        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
    78
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
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
    80
    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
    81
        '--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
    82
        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
    83
        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
    84
        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
    85
        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
    86
    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
    87
        '--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
    88
        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
    89
        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
    90
        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
    91
        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
    92
    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
    93
        '--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
    94
        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
    95
        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
    96
        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
    97
        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
    98
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
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
   100
    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
   101
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
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
   104
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
   106
    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
   107
    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
   108
        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
   109
    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
   110
        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
   111
    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
   112
    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
   113
    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
   114
    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
   115
    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
   116
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
   118
    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
   119
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    #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
   121
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    #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
   123
    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
   124
        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
   125
        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
   126
        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
   127
            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
   128
        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
   129
            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
   130
            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
   131
                # 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
   132
                # 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
   133
                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
   134
                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
   135
                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
   136
                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
   137
        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
   138
        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
   139
        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
   140
        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
   141
        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
   142
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
   144
    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
   145
                    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
   146
                    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
   147
                    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
   148
    #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
   149
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
   151
    #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
   152
    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
   153
    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
   154
    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
   155
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
   157
    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
   158
    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
   159
    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
   160
    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
   161
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
   163
        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
   164
            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
   165
        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
   166
            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
   167
        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
   168
    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
   169
        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
   170
        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
   171
    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
   172
        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
   173
            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
   174
        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
   175
            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
   176
        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
   177
    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
   178
        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
   179
    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
   180
    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
   181
    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
   182
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
   184
    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
   185
                    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
   186
                    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
   187
                    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
   188
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
   190
    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
   191
                    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
   192
                    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
   193
                    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
   194
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
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
   197
    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
   198
    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
   199
    #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
   200
    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
   201
    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
   202
    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
   203
    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
   204
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
   206
    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
   207
    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
   208
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
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
   212
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
   214
    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
   215
        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
   216
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
   218
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
   220
        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
   221
            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
   222
        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
   223
                       '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
   224
                       '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
   225
            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
   226
                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
   227
        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
   228
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
   231
        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
   232
        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
   233
            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
   234
                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
   235
            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
   236
                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
   237
            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
   238
                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
   239
            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
   240
                    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
   241
                    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
   242
                    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
   243
                    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
   244
        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
   245
            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
   246
                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
   247
            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
   248
                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
   249
            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
   250
                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
   251
            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
   252
                    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
   253
                    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
   254
                    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
   255
                    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
   256
 
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    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
   259
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
        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
   261
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
        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
   263
        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
   264
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
        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
   267
        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
   268
        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
   269
        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
   270
        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
   271
        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
   272
        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
   273
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
        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
   275
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
        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
   277
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
        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
   279
            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
   280
        
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
        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
   282
        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
   283
            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
   284
                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
   285
                    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
   286
                        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
   287
                    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
   288
                        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
   289
                            
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
            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
   291
            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
   292
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
        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
   294
            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
   295
        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
   296
        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
   297
                      % 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
   298
    
40d6b5e3dcd7 First Regards Signés Commit. Caution : ldt is 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
    return adjust_options, extend_parser, after_install