| author | ymh <ymh.work@gmail.com> |
| Fri, 16 Nov 2012 18:33:51 +0100 | |
| changeset 65 | 6289931858a7 |
| parent 6 | 5514662f70af |
| permissions | -rwxr-xr-x |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/env python |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
"""Create a "virtual" Python installation |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
# If you change the version here, change it in setup.py |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
# and docs/conf.py as well. |
| 6 | 7 |
__version__ = "1.8.2" # following best practices |
8 |
virtualenv_version = __version__ # legacy, again |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
import base64 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
import sys |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
import os |
| 6 | 13 |
import codecs |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
14 |
import optparse |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
import re |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
16 |
import shutil |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
import logging |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
import tempfile |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
19 |
import zlib |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
20 |
import errno |
| 6 | 21 |
import glob |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
22 |
import distutils.sysconfig |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
23 |
from distutils.util import strtobool |
| 6 | 24 |
import struct |
25 |
import subprocess |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
26 |
|
| 6 | 27 |
if sys.version_info < (2, 5): |
28 |
print('ERROR: %s' % sys.exc_info()[1])
|
|
29 |
print('ERROR: this script requires Python 2.5 or greater.')
|
|
30 |
sys.exit(101) |
|
31 |
||
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
32 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
33 |
set |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
34 |
except NameError: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
35 |
from sets import Set as set |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
36 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
37 |
basestring |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
38 |
except NameError: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
39 |
basestring = str |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
40 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
41 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
42 |
import ConfigParser |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
43 |
except ImportError: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
44 |
import configparser as ConfigParser |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
45 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
46 |
join = os.path.join |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
47 |
py_version = 'python%s.%s' % (sys.version_info[0], sys.version_info[1]) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
48 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
49 |
is_jython = sys.platform.startswith('java')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
50 |
is_pypy = hasattr(sys, 'pypy_version_info') |
| 6 | 51 |
is_win = (sys.platform == 'win32') |
52 |
is_cygwin = (sys.platform == 'cygwin') |
|
53 |
is_darwin = (sys.platform == 'darwin') |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
54 |
abiflags = getattr(sys, 'abiflags', '') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
55 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
56 |
user_dir = os.path.expanduser('~')
|
| 6 | 57 |
if is_win: |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
58 |
default_storage_dir = os.path.join(user_dir, 'virtualenv') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
59 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
60 |
default_storage_dir = os.path.join(user_dir, '.virtualenv') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
61 |
default_config_file = os.path.join(default_storage_dir, 'virtualenv.ini') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
62 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
63 |
if is_pypy: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
64 |
expected_exe = 'pypy' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
65 |
elif is_jython: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
66 |
expected_exe = 'jython' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
67 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
68 |
expected_exe = 'python' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
69 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
70 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
71 |
REQUIRED_MODULES = ['os', 'posix', 'posixpath', 'nt', 'ntpath', 'genericpath', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
72 |
'fnmatch', 'locale', 'encodings', 'codecs', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
73 |
'stat', 'UserDict', 'readline', 'copy_reg', 'types', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
74 |
're', 'sre', 'sre_parse', 'sre_constants', 'sre_compile', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
75 |
'zlib'] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
76 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
77 |
REQUIRED_FILES = ['lib-dynload', 'config'] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
78 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
79 |
majver, minver = sys.version_info[:2] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
80 |
if majver == 2: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
81 |
if minver >= 6: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
82 |
REQUIRED_MODULES.extend(['warnings', 'linecache', '_abcoll', 'abc']) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
83 |
if minver >= 7: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
84 |
REQUIRED_MODULES.extend(['_weakrefset']) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
85 |
if minver <= 3: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
86 |
REQUIRED_MODULES.extend(['sets', '__future__']) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
87 |
elif majver == 3: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
88 |
# Some extra modules are needed for Python 3, but different ones |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
89 |
# for different versions. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
90 |
REQUIRED_MODULES.extend(['_abcoll', 'warnings', 'linecache', 'abc', 'io', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
91 |
'_weakrefset', 'copyreg', 'tempfile', 'random', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
92 |
'__future__', 'collections', 'keyword', 'tarfile', |
| 6 | 93 |
'shutil', 'struct', 'copy', 'tokenize', 'token', |
94 |
'functools', 'heapq', 'bisect', 'weakref', |
|
95 |
'reprlib']) |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
96 |
if minver >= 2: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
97 |
REQUIRED_FILES[-1] = 'config-%s' % majver |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
98 |
if minver == 3: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
99 |
# The whole list of 3.3 modules is reproduced below - the current |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
100 |
# uncommented ones are required for 3.3 as of now, but more may be |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
101 |
# added as 3.3 development continues. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
102 |
REQUIRED_MODULES.extend([ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
103 |
#"aifc", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
104 |
#"antigravity", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
105 |
#"argparse", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
106 |
#"ast", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
107 |
#"asynchat", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
108 |
#"asyncore", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
109 |
"base64", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
110 |
#"bdb", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
111 |
#"binhex", |
| 6 | 112 |
#"bisect", |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
113 |
#"calendar", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
114 |
#"cgi", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
115 |
#"cgitb", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
116 |
#"chunk", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
117 |
#"cmd", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
118 |
#"codeop", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
119 |
#"code", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
120 |
#"colorsys", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
121 |
#"_compat_pickle", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
122 |
#"compileall", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
123 |
#"concurrent", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
124 |
#"configparser", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
125 |
#"contextlib", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
126 |
#"cProfile", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
127 |
#"crypt", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
128 |
#"csv", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
129 |
#"ctypes", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
130 |
#"curses", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
131 |
#"datetime", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
132 |
#"dbm", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
133 |
#"decimal", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
134 |
#"difflib", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
135 |
#"dis", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
136 |
#"doctest", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
137 |
#"dummy_threading", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
138 |
"_dummy_thread", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
139 |
#"email", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
140 |
#"filecmp", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
141 |
#"fileinput", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
142 |
#"formatter", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
143 |
#"fractions", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
144 |
#"ftplib", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
145 |
#"functools", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
146 |
#"getopt", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
147 |
#"getpass", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
148 |
#"gettext", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
149 |
#"glob", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
150 |
#"gzip", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
151 |
"hashlib", |
| 6 | 152 |
#"heapq", |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
153 |
"hmac", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
154 |
#"html", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
155 |
#"http", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
156 |
#"idlelib", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
157 |
#"imaplib", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
158 |
#"imghdr", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
159 |
#"importlib", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
160 |
#"inspect", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
161 |
#"json", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
162 |
#"lib2to3", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
163 |
#"logging", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
164 |
#"macpath", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
165 |
#"macurl2path", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
166 |
#"mailbox", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
167 |
#"mailcap", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
168 |
#"_markupbase", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
169 |
#"mimetypes", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
170 |
#"modulefinder", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
171 |
#"multiprocessing", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
172 |
#"netrc", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
173 |
#"nntplib", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
174 |
#"nturl2path", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
175 |
#"numbers", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
176 |
#"opcode", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
177 |
#"optparse", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
178 |
#"os2emxpath", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
179 |
#"pdb", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
180 |
#"pickle", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
181 |
#"pickletools", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
182 |
#"pipes", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
183 |
#"pkgutil", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
184 |
#"platform", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
185 |
#"plat-linux2", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
186 |
#"plistlib", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
187 |
#"poplib", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
188 |
#"pprint", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
189 |
#"profile", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
190 |
#"pstats", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
191 |
#"pty", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
192 |
#"pyclbr", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
193 |
#"py_compile", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
194 |
#"pydoc_data", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
195 |
#"pydoc", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
196 |
#"_pyio", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
197 |
#"queue", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
198 |
#"quopri", |
| 6 | 199 |
#"reprlib", |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
200 |
"rlcompleter", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
201 |
#"runpy", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
202 |
#"sched", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
203 |
#"shelve", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
204 |
#"shlex", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
205 |
#"smtpd", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
206 |
#"smtplib", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
207 |
#"sndhdr", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
208 |
#"socket", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
209 |
#"socketserver", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
210 |
#"sqlite3", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
211 |
#"ssl", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
212 |
#"stringprep", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
213 |
#"string", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
214 |
#"_strptime", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
215 |
#"subprocess", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
216 |
#"sunau", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
217 |
#"symbol", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
218 |
#"symtable", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
219 |
#"sysconfig", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
220 |
#"tabnanny", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
221 |
#"telnetlib", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
222 |
#"test", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
223 |
#"textwrap", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
224 |
#"this", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
225 |
#"_threading_local", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
226 |
#"threading", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
227 |
#"timeit", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
228 |
#"tkinter", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
229 |
#"tokenize", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
230 |
#"token", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
231 |
#"traceback", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
232 |
#"trace", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
233 |
#"tty", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
234 |
#"turtledemo", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
235 |
#"turtle", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
236 |
#"unittest", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
237 |
#"urllib", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
238 |
#"uuid", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
239 |
#"uu", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
240 |
#"wave", |
| 6 | 241 |
#"weakref", |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
242 |
#"webbrowser", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
243 |
#"wsgiref", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
244 |
#"xdrlib", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
245 |
#"xml", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
246 |
#"xmlrpc", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
247 |
#"zipfile", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
248 |
]) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
249 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
250 |
if is_pypy: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
251 |
# these are needed to correctly display the exceptions that may happen |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
252 |
# during the bootstrap |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
253 |
REQUIRED_MODULES.extend(['traceback', 'linecache']) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
254 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
255 |
class Logger(object): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
256 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
257 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
258 |
Logging object for use in command-line script. Allows ranges of |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
259 |
levels, to avoid some redundancy of displayed information. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
260 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
261 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
262 |
DEBUG = logging.DEBUG |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
263 |
INFO = logging.INFO |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
264 |
NOTIFY = (logging.INFO+logging.WARN)/2 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
265 |
WARN = WARNING = logging.WARN |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
266 |
ERROR = logging.ERROR |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
267 |
FATAL = logging.FATAL |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
268 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
269 |
LEVELS = [DEBUG, INFO, NOTIFY, WARN, ERROR, FATAL] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
270 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
271 |
def __init__(self, consumers): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
272 |
self.consumers = consumers |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
273 |
self.indent = 0 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
274 |
self.in_progress = None |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
275 |
self.in_progress_hanging = False |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
276 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
277 |
def debug(self, msg, *args, **kw): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
278 |
self.log(self.DEBUG, msg, *args, **kw) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
279 |
def info(self, msg, *args, **kw): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
280 |
self.log(self.INFO, msg, *args, **kw) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
281 |
def notify(self, msg, *args, **kw): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
282 |
self.log(self.NOTIFY, msg, *args, **kw) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
283 |
def warn(self, msg, *args, **kw): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
284 |
self.log(self.WARN, msg, *args, **kw) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
285 |
def error(self, msg, *args, **kw): |
| 6 | 286 |
self.log(self.ERROR, msg, *args, **kw) |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
287 |
def fatal(self, msg, *args, **kw): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
288 |
self.log(self.FATAL, msg, *args, **kw) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
289 |
def log(self, level, msg, *args, **kw): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
290 |
if args: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
291 |
if kw: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
292 |
raise TypeError( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
293 |
"You may give positional or keyword arguments, not both") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
294 |
args = args or kw |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
295 |
rendered = None |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
296 |
for consumer_level, consumer in self.consumers: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
297 |
if self.level_matches(level, consumer_level): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
298 |
if (self.in_progress_hanging |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
299 |
and consumer in (sys.stdout, sys.stderr)): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
300 |
self.in_progress_hanging = False |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
301 |
sys.stdout.write('\n')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
302 |
sys.stdout.flush() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
303 |
if rendered is None: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
304 |
if args: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
305 |
rendered = msg % args |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
306 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
307 |
rendered = msg |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
308 |
rendered = ' '*self.indent + rendered |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
309 |
if hasattr(consumer, 'write'): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
310 |
consumer.write(rendered+'\n') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
311 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
312 |
consumer(rendered) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
313 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
314 |
def start_progress(self, msg): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
315 |
assert not self.in_progress, ( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
316 |
"Tried to start_progress(%r) while in_progress %r" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
317 |
% (msg, self.in_progress)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
318 |
if self.level_matches(self.NOTIFY, self._stdout_level()): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
319 |
sys.stdout.write(msg) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
320 |
sys.stdout.flush() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
321 |
self.in_progress_hanging = True |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
322 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
323 |
self.in_progress_hanging = False |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
324 |
self.in_progress = msg |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
325 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
326 |
def end_progress(self, msg='done.'): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
327 |
assert self.in_progress, ( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
328 |
"Tried to end_progress without start_progress") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
329 |
if self.stdout_level_matches(self.NOTIFY): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
330 |
if not self.in_progress_hanging: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
331 |
# Some message has been printed out since start_progress |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
332 |
sys.stdout.write('...' + self.in_progress + msg + '\n')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
333 |
sys.stdout.flush() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
334 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
335 |
sys.stdout.write(msg + '\n') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
336 |
sys.stdout.flush() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
337 |
self.in_progress = None |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
338 |
self.in_progress_hanging = False |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
339 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
340 |
def show_progress(self): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
341 |
"""If we are in a progress scope, and no log messages have been |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
342 |
shown, write out another '.'""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
343 |
if self.in_progress_hanging: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
344 |
sys.stdout.write('.')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
345 |
sys.stdout.flush() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
346 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
347 |
def stdout_level_matches(self, level): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
348 |
"""Returns true if a message at this level will go to stdout""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
349 |
return self.level_matches(level, self._stdout_level()) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
350 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
351 |
def _stdout_level(self): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
352 |
"""Returns the level that stdout runs at""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
353 |
for level, consumer in self.consumers: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
354 |
if consumer is sys.stdout: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
355 |
return level |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
356 |
return self.FATAL |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
357 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
358 |
def level_matches(self, level, consumer_level): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
359 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
360 |
>>> l = Logger([]) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
361 |
>>> l.level_matches(3, 4) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
362 |
False |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
363 |
>>> l.level_matches(3, 2) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
364 |
True |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
365 |
>>> l.level_matches(slice(None, 3), 3) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
366 |
False |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
367 |
>>> l.level_matches(slice(None, 3), 2) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
368 |
True |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
369 |
>>> l.level_matches(slice(1, 3), 1) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
370 |
True |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
371 |
>>> l.level_matches(slice(2, 3), 1) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
372 |
False |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
373 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
374 |
if isinstance(level, slice): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
375 |
start, stop = level.start, level.stop |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
376 |
if start is not None and start > consumer_level: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
377 |
return False |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
378 |
if stop is not None and stop <= consumer_level: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
379 |
return False |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
380 |
return True |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
381 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
382 |
return level >= consumer_level |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
383 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
384 |
#@classmethod |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
385 |
def level_for_integer(cls, level): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
386 |
levels = cls.LEVELS |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
387 |
if level < 0: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
388 |
return levels[0] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
389 |
if level >= len(levels): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
390 |
return levels[-1] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
391 |
return levels[level] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
392 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
393 |
level_for_integer = classmethod(level_for_integer) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
394 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
395 |
# create a silent logger just to prevent this from being undefined |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
396 |
# will be overridden with requested verbosity main() is called. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
397 |
logger = Logger([(Logger.LEVELS[-1], sys.stdout)]) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
398 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
399 |
def mkdir(path): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
400 |
if not os.path.exists(path): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
401 |
logger.info('Creating %s', path)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
402 |
os.makedirs(path) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
403 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
404 |
logger.info('Directory %s already exists', path)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
405 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
406 |
def copyfileordir(src, dest): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
407 |
if os.path.isdir(src): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
408 |
shutil.copytree(src, dest, True) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
409 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
410 |
shutil.copy2(src, dest) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
411 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
412 |
def copyfile(src, dest, symlink=True): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
413 |
if not os.path.exists(src): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
414 |
# Some bad symlink in the src |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
415 |
logger.warn('Cannot find file %s (bad symlink)', src)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
416 |
return |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
417 |
if os.path.exists(dest): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
418 |
logger.debug('File %s already exists', dest)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
419 |
return |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
420 |
if not os.path.exists(os.path.dirname(dest)): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
421 |
logger.info('Creating parent directories for %s' % os.path.dirname(dest))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
422 |
os.makedirs(os.path.dirname(dest)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
423 |
if not os.path.islink(src): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
424 |
srcpath = os.path.abspath(src) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
425 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
426 |
srcpath = os.readlink(src) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
427 |
if symlink and hasattr(os, 'symlink') and not is_win: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
428 |
logger.info('Symlinking %s', dest)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
429 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
430 |
os.symlink(srcpath, dest) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
431 |
except (OSError, NotImplementedError): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
432 |
logger.info('Symlinking failed, copying to %s', dest)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
433 |
copyfileordir(src, dest) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
434 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
435 |
logger.info('Copying to %s', dest)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
436 |
copyfileordir(src, dest) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
437 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
438 |
def writefile(dest, content, overwrite=True): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
439 |
if not os.path.exists(dest): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
440 |
logger.info('Writing %s', dest)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
441 |
f = open(dest, 'wb') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
442 |
f.write(content.encode('utf-8'))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
443 |
f.close() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
444 |
return |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
445 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
446 |
f = open(dest, 'rb') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
447 |
c = f.read() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
448 |
f.close() |
| 6 | 449 |
if c != content.encode("utf-8"):
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
450 |
if not overwrite: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
451 |
logger.notify('File %s exists with different content; not overwriting', dest)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
452 |
return |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
453 |
logger.notify('Overwriting %s with new content', dest)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
454 |
f = open(dest, 'wb') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
455 |
f.write(content.encode('utf-8'))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
456 |
f.close() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
457 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
458 |
logger.info('Content %s already in place', dest)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
459 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
460 |
def rmtree(dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
461 |
if os.path.exists(dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
462 |
logger.notify('Deleting tree %s', dir)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
463 |
shutil.rmtree(dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
464 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
465 |
logger.info('Do not need to delete %s; already gone', dir)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
466 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
467 |
def make_exe(fn): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
468 |
if hasattr(os, 'chmod'): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
469 |
oldmode = os.stat(fn).st_mode & 0xFFF # 0o7777 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
470 |
newmode = (oldmode | 0x16D) & 0xFFF # 0o555, 0o7777 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
471 |
os.chmod(fn, newmode) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
472 |
logger.info('Changed mode of %s to %s', fn, oct(newmode))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
473 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
474 |
def _find_file(filename, dirs): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
475 |
for dir in reversed(dirs): |
| 6 | 476 |
files = glob.glob(os.path.join(dir, filename)) |
477 |
if files and os.path.exists(files[0]): |
|
478 |
return files[0] |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
479 |
return filename |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
480 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
481 |
def _install_req(py_executable, unzip=False, distribute=False, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
482 |
search_dirs=None, never_download=False): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
483 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
484 |
if search_dirs is None: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
485 |
search_dirs = file_search_dirs() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
486 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
487 |
if not distribute: |
| 6 | 488 |
setup_fn = 'setuptools-*-py%s.egg' % sys.version[:3] |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
489 |
project_name = 'setuptools' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
490 |
bootstrap_script = EZ_SETUP_PY |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
491 |
source = None |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
492 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
493 |
setup_fn = None |
| 6 | 494 |
source = 'distribute-*.tar.gz' |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
495 |
project_name = 'distribute' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
496 |
bootstrap_script = DISTRIBUTE_SETUP_PY |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
497 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
498 |
if setup_fn is not None: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
499 |
setup_fn = _find_file(setup_fn, search_dirs) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
500 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
501 |
if source is not None: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
502 |
source = _find_file(source, search_dirs) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
503 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
504 |
if is_jython and os._name == 'nt': |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
505 |
# Jython's .bat sys.executable can't handle a command line |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
506 |
# argument with newlines |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
507 |
fd, ez_setup = tempfile.mkstemp('.py')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
508 |
os.write(fd, bootstrap_script) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
509 |
os.close(fd) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
510 |
cmd = [py_executable, ez_setup] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
511 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
512 |
cmd = [py_executable, '-c', bootstrap_script] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
513 |
if unzip: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
514 |
cmd.append('--always-unzip')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
515 |
env = {}
|
| 6 | 516 |
remove_from_env = ['__PYVENV_LAUNCHER__'] |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
517 |
if logger.stdout_level_matches(logger.DEBUG): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
518 |
cmd.append('-v')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
519 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
520 |
old_chdir = os.getcwd() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
521 |
if setup_fn is not None and os.path.exists(setup_fn): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
522 |
logger.info('Using existing %s egg: %s' % (project_name, setup_fn))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
523 |
cmd.append(setup_fn) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
524 |
if os.environ.get('PYTHONPATH'):
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
525 |
env['PYTHONPATH'] = setup_fn + os.path.pathsep + os.environ['PYTHONPATH'] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
526 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
527 |
env['PYTHONPATH'] = setup_fn |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
528 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
529 |
# the source is found, let's chdir |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
530 |
if source is not None and os.path.exists(source): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
531 |
logger.info('Using existing %s egg: %s' % (project_name, source))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
532 |
os.chdir(os.path.dirname(source)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
533 |
# in this case, we want to be sure that PYTHONPATH is unset (not |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
534 |
# just empty, really unset), else CPython tries to import the |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
535 |
# site.py that it's in virtualenv_support |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
536 |
remove_from_env.append('PYTHONPATH')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
537 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
538 |
if never_download: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
539 |
logger.fatal("Can't find any local distributions of %s to install "
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
540 |
"and --never-download is set. Either re-run virtualenv " |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
541 |
"without the --never-download option, or place a %s " |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
542 |
"distribution (%s) in one of these " |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
543 |
"locations: %r" % (project_name, project_name, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
544 |
setup_fn or source, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
545 |
search_dirs)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
546 |
sys.exit(1) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
547 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
548 |
logger.info('No %s egg found; downloading' % project_name)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
549 |
cmd.extend(['--always-copy', '-U', project_name]) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
550 |
logger.start_progress('Installing %s...' % project_name)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
551 |
logger.indent += 2 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
552 |
cwd = None |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
553 |
if project_name == 'distribute': |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
554 |
env['DONT_PATCH_SETUPTOOLS'] = 'true' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
555 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
556 |
def _filter_ez_setup(line): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
557 |
return filter_ez_setup(line, project_name) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
558 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
559 |
if not os.access(os.getcwd(), os.W_OK): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
560 |
cwd = tempfile.mkdtemp() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
561 |
if source is not None and os.path.exists(source): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
562 |
# the current working dir is hostile, let's copy the |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
563 |
# tarball to a temp dir |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
564 |
target = os.path.join(cwd, os.path.split(source)[-1]) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
565 |
shutil.copy(source, target) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
566 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
567 |
call_subprocess(cmd, show_stdout=False, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
568 |
filter_stdout=_filter_ez_setup, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
569 |
extra_env=env, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
570 |
remove_from_env=remove_from_env, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
571 |
cwd=cwd) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
572 |
finally: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
573 |
logger.indent -= 2 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
574 |
logger.end_progress() |
| 6 | 575 |
if cwd is not None: |
576 |
shutil.rmtree(cwd) |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
577 |
if os.getcwd() != old_chdir: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
578 |
os.chdir(old_chdir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
579 |
if is_jython and os._name == 'nt': |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
580 |
os.remove(ez_setup) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
581 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
582 |
def file_search_dirs(): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
583 |
here = os.path.dirname(os.path.abspath(__file__)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
584 |
dirs = ['.', here, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
585 |
join(here, 'virtualenv_support')] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
586 |
if os.path.splitext(os.path.dirname(__file__))[0] != 'virtualenv': |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
587 |
# Probably some boot script; just in case virtualenv is installed... |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
588 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
589 |
import virtualenv |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
590 |
except ImportError: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
591 |
pass |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
592 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
593 |
dirs.append(os.path.join(os.path.dirname(virtualenv.__file__), 'virtualenv_support')) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
594 |
return [d for d in dirs if os.path.isdir(d)] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
595 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
596 |
def install_setuptools(py_executable, unzip=False, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
597 |
search_dirs=None, never_download=False): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
598 |
_install_req(py_executable, unzip, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
599 |
search_dirs=search_dirs, never_download=never_download) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
600 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
601 |
def install_distribute(py_executable, unzip=False, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
602 |
search_dirs=None, never_download=False): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
603 |
_install_req(py_executable, unzip, distribute=True, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
604 |
search_dirs=search_dirs, never_download=never_download) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
605 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
606 |
_pip_re = re.compile(r'^pip-.*(zip|tar.gz|tar.bz2|tgz|tbz)$', re.I) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
607 |
def install_pip(py_executable, search_dirs=None, never_download=False): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
608 |
if search_dirs is None: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
609 |
search_dirs = file_search_dirs() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
610 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
611 |
filenames = [] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
612 |
for dir in search_dirs: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
613 |
filenames.extend([join(dir, fn) for fn in os.listdir(dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
614 |
if _pip_re.search(fn)]) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
615 |
filenames = [(os.path.basename(filename).lower(), i, filename) for i, filename in enumerate(filenames)] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
616 |
filenames.sort() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
617 |
filenames = [filename for basename, i, filename in filenames] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
618 |
if not filenames: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
619 |
filename = 'pip' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
620 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
621 |
filename = filenames[-1] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
622 |
easy_install_script = 'easy_install' |
| 6 | 623 |
if is_win: |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
624 |
easy_install_script = 'easy_install-script.py' |
| 6 | 625 |
# There's two subtle issues here when invoking easy_install. |
626 |
# 1. On unix-like systems the easy_install script can *only* be executed |
|
627 |
# directly if its full filesystem path is no longer than 78 characters. |
|
628 |
# 2. A work around to [1] is to use the `python path/to/easy_install foo` |
|
629 |
# pattern, but that breaks if the path contains non-ASCII characters, as |
|
630 |
# you can't put the file encoding declaration before the shebang line. |
|
631 |
# The solution is to use Python's -x flag to skip the first line of the |
|
632 |
# script (and any ASCII decoding errors that may have occurred in that line) |
|
633 |
cmd = [py_executable, '-x', join(os.path.dirname(py_executable), easy_install_script), filename] |
|
634 |
# jython and pypy don't yet support -x |
|
635 |
if is_jython or is_pypy: |
|
636 |
cmd.remove('-x')
|
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
637 |
if filename == 'pip': |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
638 |
if never_download: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
639 |
logger.fatal("Can't find any local distributions of pip to install "
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
640 |
"and --never-download is set. Either re-run virtualenv " |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
641 |
"without the --never-download option, or place a pip " |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
642 |
"source distribution (zip/tar.gz/tar.bz2) in one of these " |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
643 |
"locations: %r" % search_dirs) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
644 |
sys.exit(1) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
645 |
logger.info('Installing pip from network...')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
646 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
647 |
logger.info('Installing existing %s distribution: %s' % (
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
648 |
os.path.basename(filename), filename)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
649 |
logger.start_progress('Installing pip...')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
650 |
logger.indent += 2 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
651 |
def _filter_setup(line): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
652 |
return filter_ez_setup(line, 'pip') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
653 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
654 |
call_subprocess(cmd, show_stdout=False, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
655 |
filter_stdout=_filter_setup) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
656 |
finally: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
657 |
logger.indent -= 2 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
658 |
logger.end_progress() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
659 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
660 |
def filter_ez_setup(line, project_name='setuptools'): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
661 |
if not line.strip(): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
662 |
return Logger.DEBUG |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
663 |
if project_name == 'distribute': |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
664 |
for prefix in ('Extracting', 'Now working', 'Installing', 'Before',
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
665 |
'Scanning', 'Setuptools', 'Egg', 'Already', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
666 |
'running', 'writing', 'reading', 'installing', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
667 |
'creating', 'copying', 'byte-compiling', 'removing', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
668 |
'Processing'): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
669 |
if line.startswith(prefix): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
670 |
return Logger.DEBUG |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
671 |
return Logger.DEBUG |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
672 |
for prefix in ['Reading ', 'Best match', 'Processing setuptools', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
673 |
'Copying setuptools', 'Adding setuptools', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
674 |
'Installing ', 'Installed ']: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
675 |
if line.startswith(prefix): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
676 |
return Logger.DEBUG |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
677 |
return Logger.INFO |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
678 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
679 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
680 |
class UpdatingDefaultsHelpFormatter(optparse.IndentedHelpFormatter): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
681 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
682 |
Custom help formatter for use in ConfigOptionParser that updates |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
683 |
the defaults before expanding them, allowing them to show up correctly |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
684 |
in the help listing |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
685 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
686 |
def expand_default(self, option): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
687 |
if self.parser is not None: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
688 |
self.parser.update_defaults(self.parser.defaults) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
689 |
return optparse.IndentedHelpFormatter.expand_default(self, option) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
690 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
691 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
692 |
class ConfigOptionParser(optparse.OptionParser): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
693 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
694 |
Custom option parser which updates its defaults by by checking the |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
695 |
configuration files and environmental variables |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
696 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
697 |
def __init__(self, *args, **kwargs): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
698 |
self.config = ConfigParser.RawConfigParser() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
699 |
self.files = self.get_config_files() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
700 |
self.config.read(self.files) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
701 |
optparse.OptionParser.__init__(self, *args, **kwargs) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
702 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
703 |
def get_config_files(self): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
704 |
config_file = os.environ.get('VIRTUALENV_CONFIG_FILE', False)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
705 |
if config_file and os.path.exists(config_file): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
706 |
return [config_file] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
707 |
return [default_config_file] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
708 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
709 |
def update_defaults(self, defaults): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
710 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
711 |
Updates the given defaults with values from the config files and |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
712 |
the environ. Does a little special handling for certain types of |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
713 |
options (lists). |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
714 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
715 |
# Then go and look for the other sources of configuration: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
716 |
config = {}
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
717 |
# 1. config files |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
718 |
config.update(dict(self.get_config_section('virtualenv')))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
719 |
# 2. environmental variables |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
720 |
config.update(dict(self.get_environ_vars())) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
721 |
# Then set the options with those values |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
722 |
for key, val in config.items(): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
723 |
key = key.replace('_', '-')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
724 |
if not key.startswith('--'):
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
725 |
key = '--%s' % key # only prefer long opts |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
726 |
option = self.get_option(key) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
727 |
if option is not None: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
728 |
# ignore empty values |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
729 |
if not val: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
730 |
continue |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
731 |
# handle multiline configs |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
732 |
if option.action == 'append': |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
733 |
val = val.split() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
734 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
735 |
option.nargs = 1 |
| 6 | 736 |
if option.action == 'store_false': |
737 |
val = not strtobool(val) |
|
738 |
elif option.action in ('store_true', 'count'):
|
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
739 |
val = strtobool(val) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
740 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
741 |
val = option.convert_value(key, val) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
742 |
except optparse.OptionValueError: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
743 |
e = sys.exc_info()[1] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
744 |
print("An error occured during configuration: %s" % e)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
745 |
sys.exit(3) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
746 |
defaults[option.dest] = val |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
747 |
return defaults |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
748 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
749 |
def get_config_section(self, name): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
750 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
751 |
Get a section of a configuration |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
752 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
753 |
if self.config.has_section(name): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
754 |
return self.config.items(name) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
755 |
return [] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
756 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
757 |
def get_environ_vars(self, prefix='VIRTUALENV_'): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
758 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
759 |
Returns a generator with all environmental vars with prefix VIRTUALENV |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
760 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
761 |
for key, val in os.environ.items(): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
762 |
if key.startswith(prefix): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
763 |
yield (key.replace(prefix, '').lower(), val) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
764 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
765 |
def get_default_values(self): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
766 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
767 |
Overridding to make updating the defaults after instantiation of |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
768 |
the option parser possible, update_defaults() does the dirty work. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
769 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
770 |
if not self.process_default_values: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
771 |
# Old, pre-Optik 1.5 behaviour. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
772 |
return optparse.Values(self.defaults) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
773 |
|
| 6 | 774 |
defaults = self.update_defaults(self.defaults.copy()) # ours |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
775 |
for option in self._get_all_options(): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
776 |
default = defaults.get(option.dest) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
777 |
if isinstance(default, basestring): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
778 |
opt_str = option.get_opt_string() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
779 |
defaults[option.dest] = option.check_value(opt_str, default) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
780 |
return optparse.Values(defaults) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
781 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
782 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
783 |
def main(): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
784 |
parser = ConfigOptionParser( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
785 |
version=virtualenv_version, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
786 |
usage="%prog [OPTIONS] DEST_DIR", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
787 |
formatter=UpdatingDefaultsHelpFormatter()) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
788 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
789 |
parser.add_option( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
790 |
'-v', '--verbose', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
791 |
action='count', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
792 |
dest='verbose', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
793 |
default=0, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
794 |
help="Increase verbosity") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
795 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
796 |
parser.add_option( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
797 |
'-q', '--quiet', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
798 |
action='count', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
799 |
dest='quiet', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
800 |
default=0, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
801 |
help='Decrease verbosity') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
802 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
803 |
parser.add_option( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
804 |
'-p', '--python', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
805 |
dest='python', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
806 |
metavar='PYTHON_EXE', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
807 |
help='The Python interpreter to use, e.g., --python=python2.5 will use the python2.5 ' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
808 |
'interpreter to create the new environment. The default is the interpreter that ' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
809 |
'virtualenv was installed with (%s)' % sys.executable) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
810 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
811 |
parser.add_option( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
812 |
'--clear', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
813 |
dest='clear', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
814 |
action='store_true', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
815 |
help="Clear out the non-root install and start from scratch") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
816 |
|
| 6 | 817 |
parser.set_defaults(system_site_packages=False) |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
818 |
parser.add_option( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
819 |
'--no-site-packages', |
| 6 | 820 |
dest='system_site_packages', |
821 |
action='store_false', |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
822 |
help="Don't give access to the global site-packages dir to the " |
| 6 | 823 |
"virtual environment (default)") |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
824 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
825 |
parser.add_option( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
826 |
'--system-site-packages', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
827 |
dest='system_site_packages', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
828 |
action='store_true', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
829 |
help="Give access to the global site-packages dir to the " |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
830 |
"virtual environment") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
831 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
832 |
parser.add_option( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
833 |
'--unzip-setuptools', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
834 |
dest='unzip_setuptools', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
835 |
action='store_true', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
836 |
help="Unzip Setuptools or Distribute when installing it") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
837 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
838 |
parser.add_option( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
839 |
'--relocatable', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
840 |
dest='relocatable', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
841 |
action='store_true', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
842 |
help='Make an EXISTING virtualenv environment relocatable. ' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
843 |
'This fixes up scripts and makes all .pth files relative') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
844 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
845 |
parser.add_option( |
| 6 | 846 |
'--distribute', '--use-distribute', # the second option is for legacy reasons here. Hi Kenneth! |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
847 |
dest='use_distribute', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
848 |
action='store_true', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
849 |
help='Use Distribute instead of Setuptools. Set environ variable ' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
850 |
'VIRTUALENV_DISTRIBUTE to make it the default ') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
851 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
852 |
default_search_dirs = file_search_dirs() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
853 |
parser.add_option( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
854 |
'--extra-search-dir', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
855 |
dest="search_dirs", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
856 |
action="append", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
857 |
default=default_search_dirs, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
858 |
help="Directory to look for setuptools/distribute/pip distributions in. " |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
859 |
"You can add any number of additional --extra-search-dir paths.") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
860 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
861 |
parser.add_option( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
862 |
'--never-download', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
863 |
dest="never_download", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
864 |
action="store_true", |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
865 |
help="Never download anything from the network. Instead, virtualenv will fail " |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
866 |
"if local distributions of setuptools/distribute/pip are not present.") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
867 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
868 |
parser.add_option( |
| 6 | 869 |
'--prompt', |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
870 |
dest='prompt', |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
871 |
help='Provides an alternative prompt prefix for this environment') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
872 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
873 |
if 'extend_parser' in globals(): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
874 |
extend_parser(parser) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
875 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
876 |
options, args = parser.parse_args() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
877 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
878 |
global logger |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
879 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
880 |
if 'adjust_options' in globals(): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
881 |
adjust_options(options, args) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
882 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
883 |
verbosity = options.verbose - options.quiet |
| 6 | 884 |
logger = Logger([(Logger.level_for_integer(2 - verbosity), sys.stdout)]) |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
885 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
886 |
if options.python and not os.environ.get('VIRTUALENV_INTERPRETER_RUNNING'):
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
887 |
env = os.environ.copy() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
888 |
interpreter = resolve_interpreter(options.python) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
889 |
if interpreter == sys.executable: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
890 |
logger.warn('Already using interpreter %s' % interpreter)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
891 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
892 |
logger.notify('Running virtualenv with interpreter %s' % interpreter)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
893 |
env['VIRTUALENV_INTERPRETER_RUNNING'] = 'true' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
894 |
file = __file__ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
895 |
if file.endswith('.pyc'):
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
896 |
file = file[:-1] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
897 |
popen = subprocess.Popen([interpreter, file] + sys.argv[1:], env=env) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
898 |
raise SystemExit(popen.wait()) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
899 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
900 |
# Force --distribute on Python 3, since setuptools is not available. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
901 |
if majver > 2: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
902 |
options.use_distribute = True |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
903 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
904 |
if os.environ.get('PYTHONDONTWRITEBYTECODE') and not options.use_distribute:
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
905 |
print( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
906 |
"The PYTHONDONTWRITEBYTECODE environment variable is " |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
907 |
"not compatible with setuptools. Either use --distribute " |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
908 |
"or unset PYTHONDONTWRITEBYTECODE.") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
909 |
sys.exit(2) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
910 |
if not args: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
911 |
print('You must provide a DEST_DIR')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
912 |
parser.print_help() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
913 |
sys.exit(2) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
914 |
if len(args) > 1: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
915 |
print('There must be only one argument: DEST_DIR (you gave %s)' % (
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
916 |
' '.join(args))) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
917 |
parser.print_help() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
918 |
sys.exit(2) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
919 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
920 |
home_dir = args[0] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
921 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
922 |
if os.environ.get('WORKING_ENV'):
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
923 |
logger.fatal('ERROR: you cannot run virtualenv while in a workingenv')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
924 |
logger.fatal('Please deactivate your workingenv, then re-run this script')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
925 |
sys.exit(3) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
926 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
927 |
if 'PYTHONHOME' in os.environ: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
928 |
logger.warn('PYTHONHOME is set. You *must* activate the virtualenv before using it')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
929 |
del os.environ['PYTHONHOME'] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
930 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
931 |
if options.relocatable: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
932 |
make_environment_relocatable(home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
933 |
return |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
934 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
935 |
create_environment(home_dir, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
936 |
site_packages=options.system_site_packages, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
937 |
clear=options.clear, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
938 |
unzip_setuptools=options.unzip_setuptools, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
939 |
use_distribute=options.use_distribute, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
940 |
prompt=options.prompt, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
941 |
search_dirs=options.search_dirs, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
942 |
never_download=options.never_download) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
943 |
if 'after_install' in globals(): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
944 |
after_install(options, home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
945 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
946 |
def call_subprocess(cmd, show_stdout=True, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
947 |
filter_stdout=None, cwd=None, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
948 |
raise_on_returncode=True, extra_env=None, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
949 |
remove_from_env=None): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
950 |
cmd_parts = [] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
951 |
for part in cmd: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
952 |
if len(part) > 45: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
953 |
part = part[:20]+"..."+part[-20:] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
954 |
if ' ' in part or '\n' in part or '"' in part or "'" in part: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
955 |
part = '"%s"' % part.replace('"', '\\"')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
956 |
if hasattr(part, 'decode'): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
957 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
958 |
part = part.decode(sys.getdefaultencoding()) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
959 |
except UnicodeDecodeError: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
960 |
part = part.decode(sys.getfilesystemencoding()) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
961 |
cmd_parts.append(part) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
962 |
cmd_desc = ' '.join(cmd_parts) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
963 |
if show_stdout: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
964 |
stdout = None |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
965 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
966 |
stdout = subprocess.PIPE |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
967 |
logger.debug("Running command %s" % cmd_desc)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
968 |
if extra_env or remove_from_env: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
969 |
env = os.environ.copy() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
970 |
if extra_env: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
971 |
env.update(extra_env) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
972 |
if remove_from_env: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
973 |
for varname in remove_from_env: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
974 |
env.pop(varname, None) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
975 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
976 |
env = None |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
977 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
978 |
proc = subprocess.Popen( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
979 |
cmd, stderr=subprocess.STDOUT, stdin=None, stdout=stdout, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
980 |
cwd=cwd, env=env) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
981 |
except Exception: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
982 |
e = sys.exc_info()[1] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
983 |
logger.fatal( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
984 |
"Error %s while executing command %s" % (e, cmd_desc)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
985 |
raise |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
986 |
all_output = [] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
987 |
if stdout is not None: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
988 |
stdout = proc.stdout |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
989 |
encoding = sys.getdefaultencoding() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
990 |
fs_encoding = sys.getfilesystemencoding() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
991 |
while 1: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
992 |
line = stdout.readline() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
993 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
994 |
line = line.decode(encoding) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
995 |
except UnicodeDecodeError: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
996 |
line = line.decode(fs_encoding) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
997 |
if not line: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
998 |
break |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
999 |
line = line.rstrip() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1000 |
all_output.append(line) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1001 |
if filter_stdout: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1002 |
level = filter_stdout(line) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1003 |
if isinstance(level, tuple): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1004 |
level, line = level |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1005 |
logger.log(level, line) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1006 |
if not logger.stdout_level_matches(level): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1007 |
logger.show_progress() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1008 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1009 |
logger.info(line) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1010 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1011 |
proc.communicate() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1012 |
proc.wait() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1013 |
if proc.returncode: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1014 |
if raise_on_returncode: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1015 |
if all_output: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1016 |
logger.notify('Complete output from command %s:' % cmd_desc)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1017 |
logger.notify('\n'.join(all_output) + '\n----------------------------------------')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1018 |
raise OSError( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1019 |
"Command %s failed with error code %s" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1020 |
% (cmd_desc, proc.returncode)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1021 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1022 |
logger.warn( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1023 |
"Command %s had error code %s" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1024 |
% (cmd_desc, proc.returncode)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1025 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1026 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1027 |
def create_environment(home_dir, site_packages=False, clear=False, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1028 |
unzip_setuptools=False, use_distribute=False, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1029 |
prompt=None, search_dirs=None, never_download=False): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1030 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1031 |
Creates a new environment in ``home_dir``. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1032 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1033 |
If ``site_packages`` is true, then the global ``site-packages/`` |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1034 |
directory will be on the path. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1035 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1036 |
If ``clear`` is true (default False) then the environment will |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1037 |
first be cleared. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1038 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1039 |
home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1040 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1041 |
py_executable = os.path.abspath(install_python( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1042 |
home_dir, lib_dir, inc_dir, bin_dir, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1043 |
site_packages=site_packages, clear=clear)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1044 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1045 |
install_distutils(home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1046 |
|
| 6 | 1047 |
if use_distribute: |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1048 |
install_distribute(py_executable, unzip=unzip_setuptools, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1049 |
search_dirs=search_dirs, never_download=never_download) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1050 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1051 |
install_setuptools(py_executable, unzip=unzip_setuptools, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1052 |
search_dirs=search_dirs, never_download=never_download) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1053 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1054 |
install_pip(py_executable, search_dirs=search_dirs, never_download=never_download) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1055 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1056 |
install_activate(home_dir, bin_dir, prompt) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1057 |
|
| 6 | 1058 |
def is_executable_file(fpath): |
1059 |
return os.path.isfile(fpath) and os.access(fpath, os.X_OK) |
|
1060 |
||
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1061 |
def path_locations(home_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1062 |
"""Return the path locations for the environment (where libraries are, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1063 |
where scripts go, etc)""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1064 |
# XXX: We'd use distutils.sysconfig.get_python_inc/lib but its |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1065 |
# prefix arg is broken: http://bugs.python.org/issue3386 |
| 6 | 1066 |
if is_win: |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1067 |
# Windows has lots of problems with executables with spaces in |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1068 |
# the name; this function will remove them (using the ~1 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1069 |
# format): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1070 |
mkdir(home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1071 |
if ' ' in home_dir: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1072 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1073 |
import win32api |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1074 |
except ImportError: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1075 |
print('Error: the path "%s" has a space in it' % home_dir)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1076 |
print('To handle these kinds of paths, the win32api module must be installed:')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1077 |
print(' http://sourceforge.net/projects/pywin32/')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1078 |
sys.exit(3) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1079 |
home_dir = win32api.GetShortPathName(home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1080 |
lib_dir = join(home_dir, 'Lib') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1081 |
inc_dir = join(home_dir, 'Include') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1082 |
bin_dir = join(home_dir, 'Scripts') |
| 6 | 1083 |
if is_jython: |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1084 |
lib_dir = join(home_dir, 'Lib') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1085 |
inc_dir = join(home_dir, 'Include') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1086 |
bin_dir = join(home_dir, 'bin') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1087 |
elif is_pypy: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1088 |
lib_dir = home_dir |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1089 |
inc_dir = join(home_dir, 'include') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1090 |
bin_dir = join(home_dir, 'bin') |
| 6 | 1091 |
elif not is_win: |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1092 |
lib_dir = join(home_dir, 'lib', py_version) |
| 6 | 1093 |
multiarch_exec = '/usr/bin/multiarch-platform' |
1094 |
if is_executable_file(multiarch_exec): |
|
1095 |
# In Mageia (2) and Mandriva distros the include dir must be like: |
|
1096 |
# virtualenv/include/multiarch-x86_64-linux/python2.7 |
|
1097 |
# instead of being virtualenv/include/python2.7 |
|
1098 |
p = subprocess.Popen(multiarch_exec, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
|
1099 |
stdout, stderr = p.communicate() |
|
1100 |
# stdout.strip is needed to remove newline character |
|
1101 |
inc_dir = join(home_dir, 'include', stdout.strip(), py_version + abiflags) |
|
1102 |
else: |
|
1103 |
inc_dir = join(home_dir, 'include', py_version + abiflags) |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1104 |
bin_dir = join(home_dir, 'bin') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1105 |
return home_dir, lib_dir, inc_dir, bin_dir |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1106 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1107 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1108 |
def change_prefix(filename, dst_prefix): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1109 |
prefixes = [sys.prefix] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1110 |
|
| 6 | 1111 |
if is_darwin: |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1112 |
prefixes.extend(( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1113 |
os.path.join("/Library/Python", sys.version[:3], "site-packages"),
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1114 |
os.path.join(sys.prefix, "Extras", "lib", "python"), |
| 6 | 1115 |
os.path.join("~", "Library", "Python", sys.version[:3], "site-packages"),
|
1116 |
# Python 2.6 no-frameworks |
|
1117 |
os.path.join("~", ".local", "lib","python", sys.version[:3], "site-packages"),
|
|
1118 |
# System Python 2.7 on OSX Mountain Lion |
|
1119 |
os.path.join("~", "Library", "Python", sys.version[:3], "lib", "python", "site-packages")))
|
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1120 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1121 |
if hasattr(sys, 'real_prefix'): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1122 |
prefixes.append(sys.real_prefix) |
| 6 | 1123 |
prefixes = list(map(os.path.expanduser, prefixes)) |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1124 |
prefixes = list(map(os.path.abspath, prefixes)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1125 |
filename = os.path.abspath(filename) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1126 |
for src_prefix in prefixes: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1127 |
if filename.startswith(src_prefix): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1128 |
_, relpath = filename.split(src_prefix, 1) |
| 6 | 1129 |
if src_prefix != os.sep: # sys.prefix == "/" |
1130 |
assert relpath[0] == os.sep |
|
1131 |
relpath = relpath[1:] |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1132 |
return join(dst_prefix, relpath) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1133 |
assert False, "Filename %s does not start with any of these prefixes: %s" % \ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1134 |
(filename, prefixes) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1135 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1136 |
def copy_required_modules(dst_prefix): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1137 |
import imp |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1138 |
# If we are running under -p, we need to remove the current |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1139 |
# directory from sys.path temporarily here, so that we |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1140 |
# definitely get the modules from the site directory of |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1141 |
# the interpreter we are running under, not the one |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1142 |
# virtualenv.py is installed under (which might lead to py2/py3 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1143 |
# incompatibility issues) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1144 |
_prev_sys_path = sys.path |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1145 |
if os.environ.get('VIRTUALENV_INTERPRETER_RUNNING'):
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1146 |
sys.path = sys.path[1:] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1147 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1148 |
for modname in REQUIRED_MODULES: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1149 |
if modname in sys.builtin_module_names: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1150 |
logger.info("Ignoring built-in bootstrap module: %s" % modname)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1151 |
continue |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1152 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1153 |
f, filename, _ = imp.find_module(modname) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1154 |
except ImportError: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1155 |
logger.info("Cannot import bootstrap module: %s" % modname)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1156 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1157 |
if f is not None: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1158 |
f.close() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1159 |
dst_filename = change_prefix(filename, dst_prefix) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1160 |
copyfile(filename, dst_filename) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1161 |
if filename.endswith('.pyc'):
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1162 |
pyfile = filename[:-1] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1163 |
if os.path.exists(pyfile): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1164 |
copyfile(pyfile, dst_filename[:-1]) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1165 |
finally: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1166 |
sys.path = _prev_sys_path |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1167 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1168 |
def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1169 |
"""Install just the base environment, no distutils patches etc""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1170 |
if sys.executable.startswith(bin_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1171 |
print('Please use the *system* python to run this script')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1172 |
return |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1173 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1174 |
if clear: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1175 |
rmtree(lib_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1176 |
## FIXME: why not delete it? |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1177 |
## Maybe it should delete everything with #!/path/to/venv/python in it |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1178 |
logger.notify('Not deleting %s', bin_dir)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1179 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1180 |
if hasattr(sys, 'real_prefix'): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1181 |
logger.notify('Using real prefix %r' % sys.real_prefix)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1182 |
prefix = sys.real_prefix |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1183 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1184 |
prefix = sys.prefix |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1185 |
mkdir(lib_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1186 |
fix_lib64(lib_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1187 |
stdlib_dirs = [os.path.dirname(os.__file__)] |
| 6 | 1188 |
if is_win: |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1189 |
stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs')) |
| 6 | 1190 |
elif is_darwin: |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1191 |
stdlib_dirs.append(join(stdlib_dirs[0], 'site-packages')) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1192 |
if hasattr(os, 'symlink'): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1193 |
logger.info('Symlinking Python bootstrap modules')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1194 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1195 |
logger.info('Copying Python bootstrap modules')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1196 |
logger.indent += 2 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1197 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1198 |
# copy required files... |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1199 |
for stdlib_dir in stdlib_dirs: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1200 |
if not os.path.isdir(stdlib_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1201 |
continue |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1202 |
for fn in os.listdir(stdlib_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1203 |
bn = os.path.splitext(fn)[0] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1204 |
if fn != 'site-packages' and bn in REQUIRED_FILES: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1205 |
copyfile(join(stdlib_dir, fn), join(lib_dir, fn)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1206 |
# ...and modules |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1207 |
copy_required_modules(home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1208 |
finally: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1209 |
logger.indent -= 2 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1210 |
mkdir(join(lib_dir, 'site-packages')) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1211 |
import site |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1212 |
site_filename = site.__file__ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1213 |
if site_filename.endswith('.pyc'):
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1214 |
site_filename = site_filename[:-1] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1215 |
elif site_filename.endswith('$py.class'):
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1216 |
site_filename = site_filename.replace('$py.class', '.py')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1217 |
site_filename_dst = change_prefix(site_filename, home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1218 |
site_dir = os.path.dirname(site_filename_dst) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1219 |
writefile(site_filename_dst, SITE_PY) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1220 |
writefile(join(site_dir, 'orig-prefix.txt'), prefix) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1221 |
site_packages_filename = join(site_dir, 'no-global-site-packages.txt') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1222 |
if not site_packages: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1223 |
writefile(site_packages_filename, '') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1224 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1225 |
if is_pypy or is_win: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1226 |
stdinc_dir = join(prefix, 'include') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1227 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1228 |
stdinc_dir = join(prefix, 'include', py_version + abiflags) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1229 |
if os.path.exists(stdinc_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1230 |
copyfile(stdinc_dir, inc_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1231 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1232 |
logger.debug('No include dir %s' % stdinc_dir)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1233 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1234 |
# pypy never uses exec_prefix, just ignore it |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1235 |
if sys.exec_prefix != prefix and not is_pypy: |
| 6 | 1236 |
if is_win: |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1237 |
exec_dir = join(sys.exec_prefix, 'lib') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1238 |
elif is_jython: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1239 |
exec_dir = join(sys.exec_prefix, 'Lib') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1240 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1241 |
exec_dir = join(sys.exec_prefix, 'lib', py_version) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1242 |
for fn in os.listdir(exec_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1243 |
copyfile(join(exec_dir, fn), join(lib_dir, fn)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1244 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1245 |
if is_jython: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1246 |
# Jython has either jython-dev.jar and javalib/ dir, or just |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1247 |
# jython.jar |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1248 |
for name in 'jython-dev.jar', 'javalib', 'jython.jar': |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1249 |
src = join(prefix, name) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1250 |
if os.path.exists(src): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1251 |
copyfile(src, join(home_dir, name)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1252 |
# XXX: registry should always exist after Jython 2.5rc1 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1253 |
src = join(prefix, 'registry') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1254 |
if os.path.exists(src): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1255 |
copyfile(src, join(home_dir, 'registry'), symlink=False) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1256 |
copyfile(join(prefix, 'cachedir'), join(home_dir, 'cachedir'), |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1257 |
symlink=False) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1258 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1259 |
mkdir(bin_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1260 |
py_executable = join(bin_dir, os.path.basename(sys.executable)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1261 |
if 'Python.framework' in prefix: |
| 6 | 1262 |
# OS X framework builds cause validation to break |
1263 |
# https://github.com/pypa/virtualenv/issues/322 |
|
1264 |
if os.environ.get('__PYVENV_LAUNCHER__'):
|
|
1265 |
os.unsetenv('__PYVENV_LAUNCHER__')
|
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1266 |
if re.search(r'/Python(?:-32|-64)*$', py_executable): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1267 |
# The name of the python executable is not quite what |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1268 |
# we want, rename it. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1269 |
py_executable = os.path.join( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1270 |
os.path.dirname(py_executable), 'python') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1271 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1272 |
logger.notify('New %s executable in %s', expected_exe, py_executable)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1273 |
pcbuild_dir = os.path.dirname(sys.executable) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1274 |
pyd_pth = os.path.join(lib_dir, 'site-packages', 'virtualenv_builddir_pyd.pth') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1275 |
if is_win and os.path.exists(os.path.join(pcbuild_dir, 'build.bat')): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1276 |
logger.notify('Detected python running from build directory %s', pcbuild_dir)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1277 |
logger.notify('Writing .pth file linking to build directory for *.pyd files')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1278 |
writefile(pyd_pth, pcbuild_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1279 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1280 |
pcbuild_dir = None |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1281 |
if os.path.exists(pyd_pth): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1282 |
logger.info('Deleting %s (not Windows env or not build directory python)' % pyd_pth)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1283 |
os.unlink(pyd_pth) |
| 6 | 1284 |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1285 |
if sys.executable != py_executable: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1286 |
## FIXME: could I just hard link? |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1287 |
executable = sys.executable |
| 6 | 1288 |
if is_cygwin and os.path.exists(executable + '.exe'): |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1289 |
# Cygwin misreports sys.executable sometimes |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1290 |
executable += '.exe' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1291 |
py_executable += '.exe' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1292 |
logger.info('Executable actually exists in %s' % executable)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1293 |
shutil.copyfile(executable, py_executable) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1294 |
make_exe(py_executable) |
| 6 | 1295 |
if is_win or is_cygwin: |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1296 |
pythonw = os.path.join(os.path.dirname(sys.executable), 'pythonw.exe') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1297 |
if os.path.exists(pythonw): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1298 |
logger.info('Also created pythonw.exe')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1299 |
shutil.copyfile(pythonw, os.path.join(os.path.dirname(py_executable), 'pythonw.exe')) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1300 |
python_d = os.path.join(os.path.dirname(sys.executable), 'python_d.exe') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1301 |
python_d_dest = os.path.join(os.path.dirname(py_executable), 'python_d.exe') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1302 |
if os.path.exists(python_d): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1303 |
logger.info('Also created python_d.exe')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1304 |
shutil.copyfile(python_d, python_d_dest) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1305 |
elif os.path.exists(python_d_dest): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1306 |
logger.info('Removed python_d.exe as it is no longer at the source')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1307 |
os.unlink(python_d_dest) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1308 |
# we need to copy the DLL to enforce that windows will load the correct one. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1309 |
# may not exist if we are cygwin. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1310 |
py_executable_dll = 'python%s%s.dll' % ( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1311 |
sys.version_info[0], sys.version_info[1]) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1312 |
py_executable_dll_d = 'python%s%s_d.dll' % ( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1313 |
sys.version_info[0], sys.version_info[1]) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1314 |
pythondll = os.path.join(os.path.dirname(sys.executable), py_executable_dll) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1315 |
pythondll_d = os.path.join(os.path.dirname(sys.executable), py_executable_dll_d) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1316 |
pythondll_d_dest = os.path.join(os.path.dirname(py_executable), py_executable_dll_d) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1317 |
if os.path.exists(pythondll): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1318 |
logger.info('Also created %s' % py_executable_dll)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1319 |
shutil.copyfile(pythondll, os.path.join(os.path.dirname(py_executable), py_executable_dll)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1320 |
if os.path.exists(pythondll_d): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1321 |
logger.info('Also created %s' % py_executable_dll_d)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1322 |
shutil.copyfile(pythondll_d, pythondll_d_dest) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1323 |
elif os.path.exists(pythondll_d_dest): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1324 |
logger.info('Removed %s as the source does not exist' % pythondll_d_dest)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1325 |
os.unlink(pythondll_d_dest) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1326 |
if is_pypy: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1327 |
# make a symlink python --> pypy-c |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1328 |
python_executable = os.path.join(os.path.dirname(py_executable), 'python') |
| 6 | 1329 |
if sys.platform in ('win32', 'cygwin'):
|
1330 |
python_executable += '.exe' |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1331 |
logger.info('Also created executable %s' % python_executable)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1332 |
copyfile(py_executable, python_executable) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1333 |
|
| 6 | 1334 |
if is_win: |
1335 |
for name in 'libexpat.dll', 'libpypy.dll', 'libpypy-c.dll', 'libeay32.dll', 'ssleay32.dll', 'sqlite.dll': |
|
1336 |
src = join(prefix, name) |
|
1337 |
if os.path.exists(src): |
|
1338 |
copyfile(src, join(bin_dir, name)) |
|
1339 |
||
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1340 |
if os.path.splitext(os.path.basename(py_executable))[0] != expected_exe: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1341 |
secondary_exe = os.path.join(os.path.dirname(py_executable), |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1342 |
expected_exe) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1343 |
py_executable_ext = os.path.splitext(py_executable)[1] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1344 |
if py_executable_ext == '.exe': |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1345 |
# python2.4 gives an extension of '.4' :P |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1346 |
secondary_exe += py_executable_ext |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1347 |
if os.path.exists(secondary_exe): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1348 |
logger.warn('Not overwriting existing %s script %s (you must use %s)'
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1349 |
% (expected_exe, secondary_exe, py_executable)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1350 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1351 |
logger.notify('Also creating executable in %s' % secondary_exe)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1352 |
shutil.copyfile(sys.executable, secondary_exe) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1353 |
make_exe(secondary_exe) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1354 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1355 |
if '.framework' in prefix: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1356 |
if 'Python.framework' in prefix: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1357 |
logger.debug('MacOSX Python framework detected')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1358 |
# Make sure we use the the embedded interpreter inside |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1359 |
# the framework, even if sys.executable points to |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1360 |
# the stub executable in ${sys.prefix}/bin
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1361 |
# See http://groups.google.com/group/python-virtualenv/ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1362 |
# browse_thread/thread/17cab2f85da75951 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1363 |
original_python = os.path.join( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1364 |
prefix, 'Resources/Python.app/Contents/MacOS/Python') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1365 |
if 'EPD' in prefix: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1366 |
logger.debug('EPD framework detected')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1367 |
original_python = os.path.join(prefix, 'bin/python') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1368 |
shutil.copy(original_python, py_executable) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1369 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1370 |
# Copy the framework's dylib into the virtual |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1371 |
# environment |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1372 |
virtual_lib = os.path.join(home_dir, '.Python') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1373 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1374 |
if os.path.exists(virtual_lib): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1375 |
os.unlink(virtual_lib) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1376 |
copyfile( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1377 |
os.path.join(prefix, 'Python'), |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1378 |
virtual_lib) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1379 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1380 |
# And then change the install_name of the copied python executable |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1381 |
try: |
| 6 | 1382 |
mach_o_change(py_executable, |
1383 |
os.path.join(prefix, 'Python'), |
|
1384 |
'@executable_path/../.Python') |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1385 |
except: |
| 6 | 1386 |
e = sys.exc_info()[1] |
1387 |
logger.warn("Could not call mach_o_change: %s. "
|
|
1388 |
"Trying to call install_name_tool instead." % e) |
|
1389 |
try: |
|
1390 |
call_subprocess( |
|
1391 |
["install_name_tool", "-change", |
|
1392 |
os.path.join(prefix, 'Python'), |
|
1393 |
'@executable_path/../.Python', |
|
1394 |
py_executable]) |
|
1395 |
except: |
|
1396 |
logger.fatal("Could not call install_name_tool -- you must "
|
|
1397 |
"have Apple's development tools installed") |
|
1398 |
raise |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1399 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1400 |
# Some tools depend on pythonX.Y being present |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1401 |
py_executable_version = '%s.%s' % ( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1402 |
sys.version_info[0], sys.version_info[1]) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1403 |
if not py_executable.endswith(py_executable_version): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1404 |
# symlinking pythonX.Y > python |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1405 |
pth = py_executable + '%s.%s' % ( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1406 |
sys.version_info[0], sys.version_info[1]) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1407 |
if os.path.exists(pth): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1408 |
os.unlink(pth) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1409 |
os.symlink('python', pth)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1410 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1411 |
# reverse symlinking python -> pythonX.Y (with --python) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1412 |
pth = join(bin_dir, 'python') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1413 |
if os.path.exists(pth): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1414 |
os.unlink(pth) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1415 |
os.symlink(os.path.basename(py_executable), pth) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1416 |
|
| 6 | 1417 |
if is_win and ' ' in py_executable: |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1418 |
# There's a bug with subprocess on Windows when using a first |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1419 |
# argument that has a space in it. Instead we have to quote |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1420 |
# the value: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1421 |
py_executable = '"%s"' % py_executable |
| 6 | 1422 |
# NOTE: keep this check as one line, cmd.exe doesn't cope with line breaks |
1423 |
cmd = [py_executable, '-c', 'import sys;out=sys.stdout;' |
|
1424 |
'getattr(out, "buffer", out).write(sys.prefix.encode("utf-8"))']
|
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1425 |
logger.info('Testing executable with %s %s "%s"' % tuple(cmd))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1426 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1427 |
proc = subprocess.Popen(cmd, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1428 |
stdout=subprocess.PIPE) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1429 |
proc_stdout, proc_stderr = proc.communicate() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1430 |
except OSError: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1431 |
e = sys.exc_info()[1] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1432 |
if e.errno == errno.EACCES: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1433 |
logger.fatal('ERROR: The executable %s could not be run: %s' % (py_executable, e))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1434 |
sys.exit(100) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1435 |
else: |
| 6 | 1436 |
raise e |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1437 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1438 |
proc_stdout = proc_stdout.strip().decode("utf-8")
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1439 |
proc_stdout = os.path.normcase(os.path.abspath(proc_stdout)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1440 |
norm_home_dir = os.path.normcase(os.path.abspath(home_dir)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1441 |
if hasattr(norm_home_dir, 'decode'): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1442 |
norm_home_dir = norm_home_dir.decode(sys.getfilesystemencoding()) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1443 |
if proc_stdout != norm_home_dir: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1444 |
logger.fatal( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1445 |
'ERROR: The executable %s is not functioning' % py_executable) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1446 |
logger.fatal( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1447 |
'ERROR: It thinks sys.prefix is %r (should be %r)' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1448 |
% (proc_stdout, norm_home_dir)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1449 |
logger.fatal( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1450 |
'ERROR: virtualenv is not compatible with this system or executable') |
| 6 | 1451 |
if is_win: |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1452 |
logger.fatal( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1453 |
'Note: some Windows users have reported this error when they ' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1454 |
'installed Python for "Only this user" or have multiple ' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1455 |
'versions of Python installed. Copying the appropriate ' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1456 |
'PythonXX.dll to the virtualenv Scripts/ directory may fix ' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1457 |
'this problem.') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1458 |
sys.exit(100) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1459 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1460 |
logger.info('Got sys.prefix result: %r' % proc_stdout)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1461 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1462 |
pydistutils = os.path.expanduser('~/.pydistutils.cfg')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1463 |
if os.path.exists(pydistutils): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1464 |
logger.notify('Please make sure you remove any previous custom paths from '
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1465 |
'your %s file.' % pydistutils) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1466 |
## FIXME: really this should be calculated earlier |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1467 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1468 |
fix_local_scheme(home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1469 |
|
| 6 | 1470 |
if site_packages: |
1471 |
if os.path.exists(site_packages_filename): |
|
1472 |
logger.info('Deleting %s' % site_packages_filename)
|
|
1473 |
os.unlink(site_packages_filename) |
|
1474 |
||
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1475 |
return py_executable |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1476 |
|
| 6 | 1477 |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1478 |
def install_activate(home_dir, bin_dir, prompt=None): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1479 |
home_dir = os.path.abspath(home_dir) |
| 6 | 1480 |
if is_win or is_jython and os._name == 'nt': |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1481 |
files = {
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1482 |
'activate.bat': ACTIVATE_BAT, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1483 |
'deactivate.bat': DEACTIVATE_BAT, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1484 |
'activate.ps1': ACTIVATE_PS, |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1485 |
} |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1486 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1487 |
# MSYS needs paths of the form /c/path/to/file |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1488 |
drive, tail = os.path.splitdrive(home_dir.replace(os.sep, '/')) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1489 |
home_dir_msys = (drive and "/%s%s" or "%s%s") % (drive[:1], tail) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1490 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1491 |
# Run-time conditional enables (basic) Cygwin compatibility |
| 6 | 1492 |
home_dir_sh = ("""$(if [ "$OSTYPE" "==" "cygwin" ]; then cygpath -u '%s'; else echo '%s'; fi;)""" %
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1493 |
(home_dir, home_dir_msys)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1494 |
files['activate'] = ACTIVATE_SH.replace('__VIRTUAL_ENV__', home_dir_sh)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1495 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1496 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1497 |
files = {'activate': ACTIVATE_SH}
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1498 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1499 |
# suppling activate.fish in addition to, not instead of, the |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1500 |
# bash script support. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1501 |
files['activate.fish'] = ACTIVATE_FISH |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1502 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1503 |
# same for csh/tcsh support... |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1504 |
files['activate.csh'] = ACTIVATE_CSH |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1505 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1506 |
files['activate_this.py'] = ACTIVATE_THIS |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1507 |
if hasattr(home_dir, 'decode'): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1508 |
home_dir = home_dir.decode(sys.getfilesystemencoding()) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1509 |
vname = os.path.basename(home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1510 |
for name, content in files.items(): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1511 |
content = content.replace('__VIRTUAL_PROMPT__', prompt or '')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1512 |
content = content.replace('__VIRTUAL_WINPROMPT__', prompt or '(%s)' % vname)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1513 |
content = content.replace('__VIRTUAL_ENV__', home_dir)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1514 |
content = content.replace('__VIRTUAL_NAME__', vname)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1515 |
content = content.replace('__BIN_NAME__', os.path.basename(bin_dir))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1516 |
writefile(os.path.join(bin_dir, name), content) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1517 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1518 |
def install_distutils(home_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1519 |
distutils_path = change_prefix(distutils.__path__[0], home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1520 |
mkdir(distutils_path) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1521 |
## FIXME: maybe this prefix setting should only be put in place if |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1522 |
## there's a local distutils.cfg with a prefix setting? |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1523 |
home_dir = os.path.abspath(home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1524 |
## FIXME: this is breaking things, removing for now: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1525 |
#distutils_cfg = DISTUTILS_CFG + "\n[install]\nprefix=%s\n" % home_dir |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1526 |
writefile(os.path.join(distutils_path, '__init__.py'), DISTUTILS_INIT) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1527 |
writefile(os.path.join(distutils_path, 'distutils.cfg'), DISTUTILS_CFG, overwrite=False) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1528 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1529 |
def fix_local_scheme(home_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1530 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1531 |
Platforms that use the "posix_local" install scheme (like Ubuntu with |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1532 |
Python 2.7) need to be given an additional "local" location, sigh. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1533 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1534 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1535 |
import sysconfig |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1536 |
except ImportError: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1537 |
pass |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1538 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1539 |
if sysconfig._get_default_scheme() == 'posix_local': |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1540 |
local_path = os.path.join(home_dir, 'local') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1541 |
if not os.path.exists(local_path): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1542 |
os.mkdir(local_path) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1543 |
for subdir_name in os.listdir(home_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1544 |
if subdir_name == 'local': |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1545 |
continue |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1546 |
os.symlink(os.path.abspath(os.path.join(home_dir, subdir_name)), \ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1547 |
os.path.join(local_path, subdir_name)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1548 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1549 |
def fix_lib64(lib_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1550 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1551 |
Some platforms (particularly Gentoo on x64) put things in lib64/pythonX.Y |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1552 |
instead of lib/pythonX.Y. If this is such a platform we'll just create a |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1553 |
symlink so lib64 points to lib |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1554 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1555 |
if [p for p in distutils.sysconfig.get_config_vars().values() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1556 |
if isinstance(p, basestring) and 'lib64' in p]: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1557 |
logger.debug('This system uses lib64; symlinking lib64 to lib')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1558 |
assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], ( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1559 |
"Unexpected python lib dir: %r" % lib_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1560 |
lib_parent = os.path.dirname(lib_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1561 |
assert os.path.basename(lib_parent) == 'lib', ( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1562 |
"Unexpected parent dir: %r" % lib_parent) |
| 6 | 1563 |
os.symlink(os.path.join('.', os.path.basename(lib_parent)),
|
1564 |
os.path.join(os.path.dirname(lib_parent), 'lib64')) |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1565 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1566 |
def resolve_interpreter(exe): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1567 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1568 |
If the executable given isn't an absolute path, search $PATH for the interpreter |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1569 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1570 |
if os.path.abspath(exe) != exe: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1571 |
paths = os.environ.get('PATH', '').split(os.pathsep)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1572 |
for path in paths: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1573 |
if os.path.exists(os.path.join(path, exe)): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1574 |
exe = os.path.join(path, exe) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1575 |
break |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1576 |
if not os.path.exists(exe): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1577 |
logger.fatal('The executable %s (from --python=%s) does not exist' % (exe, exe))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1578 |
raise SystemExit(3) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1579 |
if not is_executable(exe): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1580 |
logger.fatal('The executable %s (from --python=%s) is not executable' % (exe, exe))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1581 |
raise SystemExit(3) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1582 |
return exe |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1583 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1584 |
def is_executable(exe): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1585 |
"""Checks a file is executable""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1586 |
return os.access(exe, os.X_OK) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1587 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1588 |
############################################################ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1589 |
## Relocating the environment: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1590 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1591 |
def make_environment_relocatable(home_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1592 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1593 |
Makes the already-existing environment use relative paths, and takes out |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1594 |
the #!-based environment selection in scripts. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1595 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1596 |
home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1597 |
activate_this = os.path.join(bin_dir, 'activate_this.py') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1598 |
if not os.path.exists(activate_this): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1599 |
logger.fatal( |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1600 |
'The environment doesn\'t have a file %s -- please re-run virtualenv ' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1601 |
'on this environment to update it' % activate_this) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1602 |
fixup_scripts(home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1603 |
fixup_pth_and_egg_link(home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1604 |
## FIXME: need to fix up distutils.cfg |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1605 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1606 |
OK_ABS_SCRIPTS = ['python', 'python%s' % sys.version[:3], |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1607 |
'activate', 'activate.bat', 'activate_this.py'] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1608 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1609 |
def fixup_scripts(home_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1610 |
# This is what we expect at the top of scripts: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1611 |
shebang = '#!%s/bin/python' % os.path.normcase(os.path.abspath(home_dir)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1612 |
# This is what we'll put: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1613 |
new_shebang = '#!/usr/bin/env python%s' % sys.version[:3] |
| 6 | 1614 |
if is_win: |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1615 |
bin_suffix = 'Scripts' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1616 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1617 |
bin_suffix = 'bin' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1618 |
bin_dir = os.path.join(home_dir, bin_suffix) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1619 |
home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1620 |
for filename in os.listdir(bin_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1621 |
filename = os.path.join(bin_dir, filename) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1622 |
if not os.path.isfile(filename): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1623 |
# ignore subdirs, e.g. .svn ones. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1624 |
continue |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1625 |
f = open(filename, 'rb') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1626 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1627 |
try: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1628 |
lines = f.read().decode('utf-8').splitlines()
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1629 |
except UnicodeDecodeError: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1630 |
# This is probably a binary program instead |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1631 |
# of a script, so just ignore it. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1632 |
continue |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1633 |
finally: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1634 |
f.close() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1635 |
if not lines: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1636 |
logger.warn('Script %s is an empty file' % filename)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1637 |
continue |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1638 |
if not lines[0].strip().startswith(shebang): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1639 |
if os.path.basename(filename) in OK_ABS_SCRIPTS: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1640 |
logger.debug('Cannot make script %s relative' % filename)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1641 |
elif lines[0].strip() == new_shebang: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1642 |
logger.info('Script %s has already been made relative' % filename)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1643 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1644 |
logger.warn('Script %s cannot be made relative (it\'s not a normal script that starts with %s)'
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1645 |
% (filename, shebang)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1646 |
continue |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1647 |
logger.notify('Making script %s relative' % filename)
|
| 6 | 1648 |
script = relative_script([new_shebang] + lines[1:]) |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1649 |
f = open(filename, 'wb') |
| 6 | 1650 |
f.write('\n'.join(script).encode('utf-8'))
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1651 |
f.close() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1652 |
|
| 6 | 1653 |
def relative_script(lines): |
1654 |
"Return a script that'll work in a relocatable environment." |
|
1655 |
activate = "import os; activate_this=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'activate_this.py'); execfile(activate_this, dict(__file__=activate_this)); del os, activate_this" |
|
1656 |
# Find the last future statement in the script. If we insert the activation |
|
1657 |
# line before a future statement, Python will raise a SyntaxError. |
|
1658 |
activate_at = None |
|
1659 |
for idx, line in reversed(list(enumerate(lines))): |
|
1660 |
if line.split()[:3] == ['from', '__future__', 'import']: |
|
1661 |
activate_at = idx + 1 |
|
1662 |
break |
|
1663 |
if activate_at is None: |
|
1664 |
# Activate after the shebang. |
|
1665 |
activate_at = 1 |
|
1666 |
return lines[:activate_at] + ['', activate, ''] + lines[activate_at:] |
|
1667 |
||
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1668 |
def fixup_pth_and_egg_link(home_dir, sys_path=None): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1669 |
"""Makes .pth and .egg-link files use relative paths""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1670 |
home_dir = os.path.normcase(os.path.abspath(home_dir)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1671 |
if sys_path is None: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1672 |
sys_path = sys.path |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1673 |
for path in sys_path: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1674 |
if not path: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1675 |
path = '.' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1676 |
if not os.path.isdir(path): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1677 |
continue |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1678 |
path = os.path.normcase(os.path.abspath(path)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1679 |
if not path.startswith(home_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1680 |
logger.debug('Skipping system (non-environment) directory %s' % path)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1681 |
continue |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1682 |
for filename in os.listdir(path): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1683 |
filename = os.path.join(path, filename) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1684 |
if filename.endswith('.pth'):
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1685 |
if not os.access(filename, os.W_OK): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1686 |
logger.warn('Cannot write .pth file %s, skipping' % filename)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1687 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1688 |
fixup_pth_file(filename) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1689 |
if filename.endswith('.egg-link'):
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1690 |
if not os.access(filename, os.W_OK): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1691 |
logger.warn('Cannot write .egg-link file %s, skipping' % filename)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1692 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1693 |
fixup_egg_link(filename) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1694 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1695 |
def fixup_pth_file(filename): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1696 |
lines = [] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1697 |
prev_lines = [] |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1698 |
f = open(filename) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1699 |
prev_lines = f.readlines() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1700 |
f.close() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1701 |
for line in prev_lines: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1702 |
line = line.strip() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1703 |
if (not line or line.startswith('#') or line.startswith('import ')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1704 |
or os.path.abspath(line) != line): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1705 |
lines.append(line) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1706 |
else: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1707 |
new_value = make_relative_path(filename, line) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1708 |
if line != new_value: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1709 |
logger.debug('Rewriting path %s as %s (in %s)' % (line, new_value, filename))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1710 |
lines.append(new_value) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1711 |
if lines == prev_lines: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1712 |
logger.info('No changes to .pth file %s' % filename)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1713 |
return |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1714 |
logger.notify('Making paths in .pth file %s relative' % filename)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1715 |
f = open(filename, 'w') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1716 |
f.write('\n'.join(lines) + '\n')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1717 |
f.close() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1718 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1719 |
def fixup_egg_link(filename): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1720 |
f = open(filename) |
| 6 | 1721 |
link = f.readline().strip() |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1722 |
f.close() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1723 |
if os.path.abspath(link) != link: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1724 |
logger.debug('Link in %s already relative' % filename)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1725 |
return |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1726 |
new_link = make_relative_path(filename, link) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1727 |
logger.notify('Rewriting link %s in %s as %s' % (link, filename, new_link))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1728 |
f = open(filename, 'w') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1729 |
f.write(new_link) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1730 |
f.close() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1731 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1732 |
def make_relative_path(source, dest, dest_is_directory=True): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1733 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1734 |
Make a filename relative, where the filename is dest, and it is |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1735 |
being referred to from the filename source. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1736 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1737 |
>>> make_relative_path('/usr/share/something/a-file.pth',
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1738 |
... '/usr/share/another-place/src/Directory') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1739 |
'../another-place/src/Directory' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1740 |
>>> make_relative_path('/usr/share/something/a-file.pth',
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1741 |
... '/home/user/src/Directory') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1742 |
'../../../home/user/src/Directory' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1743 |
>>> make_relative_path('/usr/share/a-file.pth', '/usr/share/')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1744 |
'./' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1745 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1746 |
source = os.path.dirname(source) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1747 |
if not dest_is_directory: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1748 |
dest_filename = os.path.basename(dest) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1749 |
dest = os.path.dirname(dest) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1750 |
dest = os.path.normpath(os.path.abspath(dest)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1751 |
source = os.path.normpath(os.path.abspath(source)) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1752 |
dest_parts = dest.strip(os.path.sep).split(os.path.sep) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1753 |
source_parts = source.strip(os.path.sep).split(os.path.sep) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1754 |
while dest_parts and source_parts and dest_parts[0] == source_parts[0]: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1755 |
dest_parts.pop(0) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1756 |
source_parts.pop(0) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1757 |
full_parts = ['..']*len(source_parts) + dest_parts |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1758 |
if not dest_is_directory: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1759 |
full_parts.append(dest_filename) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1760 |
if not full_parts: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1761 |
# Special case for the current directory (otherwise it'd be '') |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1762 |
return './' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1763 |
return os.path.sep.join(full_parts) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1764 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1765 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1766 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1767 |
############################################################ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1768 |
## Bootstrap script creation: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1769 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1770 |
def create_bootstrap_script(extra_text, python_version=''): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1771 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1772 |
Creates a bootstrap script, which is like this script but with |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1773 |
extend_parser, adjust_options, and after_install hooks. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1774 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1775 |
This returns a string that (written to disk of course) can be used |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1776 |
as a bootstrap script with your own customizations. The script |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1777 |
will be the standard virtualenv.py script, with your extra text |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1778 |
added (your extra text should be Python code). |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1779 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1780 |
If you include these functions, they will be called: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1781 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1782 |
``extend_parser(optparse_parser)``: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1783 |
You can add or remove options from the parser here. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1784 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1785 |
``adjust_options(options, args)``: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1786 |
You can change options here, or change the args (if you accept |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1787 |
different kinds of arguments, be sure you modify ``args`` so it is |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1788 |
only ``[DEST_DIR]``). |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1789 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1790 |
``after_install(options, home_dir)``: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1791 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1792 |
After everything is installed, this function is called. This |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1793 |
is probably the function you are most likely to use. An |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1794 |
example would be:: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1795 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1796 |
def after_install(options, home_dir): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1797 |
subprocess.call([join(home_dir, 'bin', 'easy_install'), |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1798 |
'MyPackage']) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1799 |
subprocess.call([join(home_dir, 'bin', 'my-package-script'), |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1800 |
'setup', home_dir]) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1801 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1802 |
This example immediately installs a package, and runs a setup |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1803 |
script from that package. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1804 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1805 |
If you provide something like ``python_version='2.4'`` then the |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1806 |
script will start with ``#!/usr/bin/env python2.4`` instead of |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1807 |
``#!/usr/bin/env python``. You can use this when the script must |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1808 |
be run with a particular Python version. |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1809 |
""" |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1810 |
filename = __file__ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1811 |
if filename.endswith('.pyc'):
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1812 |
filename = filename[:-1] |
| 6 | 1813 |
f = codecs.open(filename, 'r', encoding='utf-8') |
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1814 |
content = f.read() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1815 |
f.close() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1816 |
py_exe = 'python%s' % python_version |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1817 |
content = (('#!/usr/bin/env %s\n' % py_exe)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1818 |
+ '## WARNING: This file is generated\n' |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1819 |
+ content) |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1820 |
return content.replace('##EXT' 'END##', extra_text)
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1821 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1822 |
##EXTEND## |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1823 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1824 |
def convert(s): |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1825 |
b = base64.b64decode(s.encode('ascii'))
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1826 |
return zlib.decompress(b).decode('utf-8')
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1827 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1828 |
##file site.py |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1829 |
SITE_PY = convert("""
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1830 |
eJzFPf1z2zaWv/OvwMqTIZXKdD66nR2n7o2TOK333MTbpLO5dT1aSoIs1hTJEqRl7c3d337vAwAB |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1831 |
kvLHpp3TdGKJBB4eHt43HtDRaHRcljJfiHWxaDIplEyq+UqUSb1SYllUol6l1WK/TKp6C0/n18mV |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1832 |
VKIuhNqqGFvFQfD0Cz/BU/FplSqDAnxLmrpYJ3U6T7JsK9J1WVS1XIhFU6X5lUjztE6TLP0XtCjy |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1833 |
WDz9cgyC01zAzLNUVuJGVgrgKlEsxfm2XhW5iJoS5/w8/nPycjwRal6lZQ0NKo0zUGSV1EEu5QLQ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1834 |
hJaNAlKmtdxXpZyny3RuG26KJluIMkvmUvzznzw1ahqGgSrWcrOSlRQ5IAMwJcAqEQ/4mlZiXixk |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1835 |
LMRrOU9wAH7eEitgaBNcM4VkzAuRFfkVzCmXc6lUUm1FNGtqAkQoi0UBOKWAQZ1mWbApqms1hiWl |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1836 |
9djAI5Ewe/iTYfaAeeL4fc4BHD/kwc95ejth2MA9CK5eMdtUcpneigTBwk95K+dT/SxKl2KRLpdA |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1837 |
g7weY5OAEVAiS2cHJS3Ht3qFvjsgrCxXJjCGRJS5Mb+kHnFwWoskU8C2TYk0UoT5WzlLkxyokd/A |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1838 |
cAARSBoMjbNIVW3HodmJAgBUuI41SMlaiWidpDkw64/JnND+e5ovio0aEwVgtZT4tVG1O/9ogADQ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1839 |
2iHAJMDFMqvZ5Fl6LbPtGBD4BNhXUjVZjQKxSCs5r4sqlYoAAGpbIW8B6YlIKqlJyJxp5HZC9Cea |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1840 |
pDkuLAoYCjy+RJIs06umIgkTyxQ4F7ji3YefxNuT16fH7zWPGWAss1drwBmg0EI7OMEA4qBR1UFW |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1841 |
gEDHwRn+EcligUJ2heMDXm2Dg3tXOohg7mXc7eMsOJBdL64eBuZYgzKhsQLq99/QZaJWQJ//uWe9 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1842 |
g+B4F1Vo4vxtsypAJvNkLcUqYf5Czgi+1XC+i8t69Qq4QSGcGkilcHEQwRThAUlcmkVFLkUJLJal |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1843 |
uRwHQKEZtfVXEVjhfZHv01p3OAEgVEEOL51nYxoxlzDRPqxXqC9M4y3NTDcJ7Dqvi4oUB/B/Pidd |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1844 |
lCX5NeGoiKH420xepXmOCCEvBOFeSAOr6xQ4cRGLM2pFesE0EiFrL26JItEALyHTAU/K22RdZnLC |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1845 |
4ou69W41QoPJWpi1zpjjoGVN6pVWrZ3qIO+9iD93uI7QrFeVBODNzBO6ZVFMxAx0NmFTJmsWr3pT |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1846 |
EOcEA/JEnZAnqCX0xe9A0WOlmrW0L5FXQLMQQwXLIsuKDZDsMAiE2MNGxij7zAlv4R38C3Dx30zW |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1847 |
81UQOCNZwBoUIr8LFAIBkyBzzdUaCY/bNCt3lUyas6YoqoWsaKiHEfuAEX9gY5xr8L6otVHj6eIq |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1848 |
F+u0RpU00yYzZYuXhzXrx1c8b5gGWG5FNDNNWzqtcXpZuUpm0rgkM7lESdCL9MouO4wZDIxJtrgW |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1849 |
a7Yy8A7IIlO2IMOKBZXOspbkBAAMFr4kT8smo0YKGUwkMNC6JPjrBE16oZ0lYG82ywEqJDbfc7A/ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1850 |
gNu/QIw2qxToMwcIoGFQS8HyzdK6Qgeh1UeBb/RNfx4fOPV0qW0TD7lM0kxb+SQPTunhSVWR+M5l |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1851 |
ib0mmhgKZpjX6Npd5UBHFPPRaBQExh3aKvO1UEFdbQ+BFYQZZzqdNSkavukUTb3+oQIeRTgDe91s |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1852 |
OwsPNITp9B6o5HRZVsUaX9u5fQRlAmNhj2BPnJOWkewge5z4CsnnqvTSNEXb7bCzQD0UnP908u70 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1853 |
88lHcSQuWpU26eqzSxjzJE+ArckiAFN1hm11GbRExZei7hPvwLwTU4A9o94kvjKpG+BdQP1T1dBr |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1854 |
mMbcexmcvD9+fXYy/fnjyU/Tj6efTgBBsDMy2KMpo3lswGFUMQgHcOVCxdq+Br0e9OD18Uf7IJim |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1855 |
alpuyy08AEMJLFxFMN+JCPHhVNvgaZovi3BMjX9lJ/yI1Yr2uC4Ov74UR0ci/DW5ScIAvJ62KS/i |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1856 |
jyQAn7alhK41/IkKNQ6ChVyCsFxLFKnoKXmyY+4ARISWhbasvxZpbt4zH7lDkMRH1ANwmE7nWaIU |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1857 |
Np5OQyAtdRj4QIeY3WGUkwg6llu361ijgp9KwlLk2GWC/wygmMyoH6LBKLpdTCMQsPU8UZJb0fSh |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1858 |
33SKWmY6jfSAIH7E4+AiseIIhWmCWqZKwRMlXkGtM1NFhj8RPsotiQwGQ6jXcJF0sBPfJFkjVeRM |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1859 |
CogYRR0yompMFXEQOBUR2M526cbjLjUNz0AzIF9WgN6rOpTDzx54KKBgTNiFoRlHS0wzxPSvHBsQ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1860 |
DuAkhqiglepAYX0mzk/OxctnL/bRAYEocWGp4zVHm5rmjbQPl7BaV7J2EOZe4YSEYezSZYmaEZ8e |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1861 |
3g1zHduV6bPCUi9xJdfFjVwAtsjAziqLn+gNxNIwj3kCqwiamCw4Kz3j6SUYOfLsQVrQ2gP11gTF |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1862 |
rL9Z+j0O32WuQHVwKEyk1nE6G6+yKm5SdA9mW/0SrBuoN7RxxhUJnIXzmAyNGGgI8FtzpNRGhqDA |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1863 |
qoZdTMIbQaKGX7SqMCZwZ6hbL+nrdV5s8inHrkeoJqOxZV0ULM282KBdgj3xDuwGIFlAKNYSjaGA |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1864 |
ky5QtvYBeZg+TBcoS9EAAALTrCjAcmCZ4IymyHEeDoswxq8ECW8l0cLfmCEoODLEcCDR29g+MFoC |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1865 |
IcHkrIKzqkEzGcqaaQYDOyTxue4s5qDRB9ChYgyGLtLQuJGh38UhKGdx5iolpx/a0M+fPzPbqBVl |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1866 |
RBCxGU4ajf6SzFtcbsEUpqATjA/F+RVigw24owCmUZo1xf5HUZTsP8F6nmvZBssN8Vhdl4cHB5vN |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1867 |
Jtb5gKK6OlDLgz//5Ztv/vKMdeJiQfwD03GkRSfH4gN6hz5o/K2xQN+ZlevwY5r73EiwIkl+FDmP |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1868 |
iN/3TbooxOH+2OpP5OLWsOK/xvkABTI1gzKVgbajFqMnav9J/FKNxBMRuW2jMXsS2qRaK+ZbXehR |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1869 |
F2C7wdOYF01eh44iVeIrsG4QUy/krLkK7eCejTQ/YKoop5Hlgf3nl4iBzxmGr4wpnqKWILZAi++Q |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1870 |
/idmm4T8Ga0hkLxoonrx7nZYixniLh4u79Y7dITGzDBVyB0oEX6TBwugbdyXHPxoZxTtnuOMmo9n |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1871 |
CIylDwzzalcwQsEhXHAtJq7UOVyNPipI04ZVMygYVzWCgga3bsbU1uDIRoYIEr0bE57zwuoWQKdO |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1872 |
rs9E9GYVoIU7Ts/adVnB8YSQB47Ec3oiwak97L17xkvbZBmlYDo86lGFAXsLjXa6AL6MDICJGFU/ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1873 |
j7ilCSw+dBaF12AAWMFZG2SwZY+Z8I3rA472RgPs1LP6u3ozjYdA4CJFnD16EHRC+YhHqBRIUxn5 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1874 |
PXexuCVuf7A7LQ4xlVkmEmm1Q7i6ymNQqO40TMs0R93rLFI8zwrwiq1WJEZq3/vOAkUu+HjImGkJ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1875 |
1GRoyeE0OiJvzxPAULfDhNdVg6kBN3OCGK1TRdYNybSCf8CtoIwEpY+AlgTNgnmolPkT+x1kzs5X |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1876 |
f9nBHpbQyBBu011uSM9iaDjm/Z5AMur8CUhBDiTsCyO5jqwOMuAwZ4E84YbXcqd0E4xYgZw5FoTU |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1877 |
DOBOL70AB5/EuGdBEoqQb2slS/GVGMHydUX1Ybr7d+VSkzaInAbkKuh8w5Gbi3DyEEedvITP0H5G |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1878 |
gnY3ygI4eAYuj5uad9ncMK1Nk4Cz7ituixRoZMqcjMYuqpeGMG76909HTouWWGYQw1DeQN4mjBlp |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1879 |
HNjl1qBhwQ0Yb827Y+nHbsYC+0ZhoV7I9S3Ef2GVqnmhQgxwe7kL96O5ok8bi+1ZOhvBH28BRuNL |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1880 |
D5LMdP4Csyz/xiChBz0cgu5NFtMii6TapHlICkzT78hfmh4elpSekTv4SOHUAUwUc5QH7yoQENqs |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1881 |
PABxQk0AUbkMlXb7+2DvnOLIwuXuI89tvjh8edkn7mRXhsd+hpfq5LauEoWrlfGisVDgavUNOCpd |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1882 |
mFySb/V2o96OxjChKhREkeLDx88CCcGZ2E2yfdzUW4ZHbO6dk/cxqINeu5dcndkRuwAiqBWRUQ7C |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1883 |
x3Pkw5F97OTumNgjgDyKYe5YFANJ88m/A+euhYIx9hfbHPNoXZWBH3j9zdfTgcyoi+Q3X4/uGaVD |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1884 |
jCGxjzqeoB2ZygDE4LRNl0omGfkaTifKKuYt79g25ZgVOsV/mskuB5xO/Jj3xmS08HvNe4Gj+ewR |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1885 |
PSDMLma/QrCqdH7rJkkzSsoDGvv7qOdMnM2pg2F8PEh3o4w5KfBYnk0GQyF18QwWJuTAftyfjvaL |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1886 |
jk3udyAgNZ8yUX1U9vQGfLt/5G2qu3uHfajamBgeesaZ/hcDWsKb8ZBd/xINh5/fRRlYYB4NRkNk |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1887 |
9xzt/+9ZPvtjJvnAqZht39/RMD0S0O81E9bjDE3r8XHHIA4tu2sCDbAHWIodHuAdHlp/aN7oWxo/ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1888 |
i1WSEk9Rdz0VG9rrpzQnbtoAlAW7YANwcBn1jvGbpqp435dUYCmrfdzLnAgsczJOGFVP9cEcvJc1 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1889 |
YmKbzSlt7BTFFENqJNSJYDuTsHXhh+VsVZj0kcxv0gr6gsKNwh8+/HgS9hlAD4OdhsG562i45OEm |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1890 |
HOE+gmlDTZzwMX2YQo/p8u9LVTeK8AlqttNNclaTbdA++DlZE9IPr8E9yRlv75T3qDFYnq/k/Hoq |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1891 |
ad8d2RS7OvnpN/gaMbHb8X7xlEqWVAEGM5lnDdKKfWAs3Vs2+Zy2KmoJro6us8W6G9pN50zcMkuu |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1892 |
RESdF5gF0txIiaKbpNKOYFkVWNkpmnRxcJUuhPytSTKMsOVyCbjgPpJ+FfPwlAwSb7kggCv+lJw3 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1893 |
VVpvgQSJKvQ2HNUOOA1nW55o5CHJOy5MQKwmOBQfcdr4ngm3MOQycbq/+YCTxBAYO5h9UuQueg7v |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1894 |
82KKo06pQHbCSPW3yOlx0B2hAAAjAArzH411Es1/I+mVu9dHa+4SFbWkR0o36C/IGUMo0RiTDvyb |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1895 |
fvqM6PLWDiyvdmN5dTeWV10srwaxvPKxvLobS1ckcGFt/shIwlAOqbvDMFis4qZ/eJiTZL7idlg4 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1896 |
iQWSAFGUJtY1MsX1w16SibfaCAipbWfvlx62xScpV2RWBWejNUjkftxP0nG1qfx2OlMpi+7MUzHu |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1897 |
7K4CHL/vQRxTndWMurO8LZI6iT25uMqKGYitRXfSApiIbi0Opy3zm+mME60dSzU6/69PP3x4j80R |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1898 |
1MhUGlA3XEQ0LDiV6GlSXam+NLVxWAnsSC39mhjqpgHuPTDJxaPs8T9vqdgCGUdsqFigECV4AFQS |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1899 |
ZZu5hUNh2HmuK4z0c2Zy3vc5EqO8HrWT2kGk4/Pzt8efjkeUfRv978gVGENbXzpcfEwL26Dvv7nN |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1900 |
LcWxDwi1TjO1xs+dk0frliPut7EGbM+H7zx48RCDPRix+7P8QykFSwKEinUe9jGEenAM9EVhQo8+ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1901 |
hhF7lXPuJhc7K/adI3uOi+KI/tAOQHcAf98RY4wpEEC7UJGJDNpgqqP0rXm9g6IO0Af6el8cgnVD |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1902 |
r24k41PUTmLAAXQoa5vtdv+8LRM2ekrWr0++P31/dvr6/PjTD44LiK7ch48HL8TJj58FlWqgAWOf |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1903 |
KMEqhRqLgsCwuKeExKKA/xrM/CyamvO10Ovt2ZneNFnjOREsHEabE8Nzriiy0Dh9xQlh+1CXAiFG |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1904 |
mQ6QnAM5VDlDB3YwXlrzYRBV6OJiOuczQ2e10aGXPmhlDmTRFnMM0geNXVIwCK72gldUAl6bqLDi |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1905 |
zTh9SGkAKW2jbY1GRum53s69sxVlNjq8nCV1hidtZ63oL0IX1/AyVmWWQiT3KrSypLthpUrLOPqh |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1906 |
3WtmvIY0oNMdRtYNedY7sUCr9Srkuen+45bRfmsAw5bB3sK8c0mVGlS+jHVmIsRGvKkSylv4apde |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1907 |
r4GCBcM9txoX0TBdCrNPILgWqxQCCODJFVhfjBMAQmcl/Nz8oZMdkAUWSoRv1ov9v4WaIH7rX34Z |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1908 |
aF5X2f4/RAlRkOCqnnCAmG7jtxD4xDIWJx/ejUNGjqpkxd8arK0Hh4QSoI60UykRb2ZPIyWzpS71 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1909 |
8PUBvtB+Ar3udK9kWenuw65xiBLwREXkNTxRhn4hVl5Z2BOcyrgDGo8NWMzw+J1bEWA+e+LjSmaZ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1910 |
LhY/fXt2Ar4jnmRACeItsBMYjvMluJut6+D4eGAHFO51w+sK2bhCF5bqHRax12wwaY0iR729Egm7 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1911 |
TpQY7vfqZYGrJFUu2hFOm2GZWvwYWRnWwiwrs3anDVLYbUMUR5lhlpieV1RL6vME8DI9TTgkglgJ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1912 |
z0mYDDxv6KZ5bYoHs3QOehRULijUCQgJEhcPAxLnFTnnwItKmTNE8LDcVunVqsZ9Bugc0/kFbP7j |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1913 |
8eez0/dU0//iZet1DzDnhCKBCddzHGG1HmY74ItbgYdcNZ0O8ax+hTBQ+8Cf7isuFDniAXr9OLGI |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1914 |
f7qv+BDXkRMJ8gxAQTVlVzwwAHC6DclNKwuMq42D8eNW47WY+WAoF4lnRnTNhTu/Pifalh1TQnkf |
| 6 | 1915 |
8/IRGzjL0laH6c5udVj3o+e4LHHHaRENN4K3Q7JlPjPoet17s6sOzf30pBDPkwJG/db+GKZQq9dU |
1916 |
T8dhtl3cQmGttrG/5E6u1Gk3z1GUgYiR23nsMtmwEtbNmQO9iuYeMPGtRtdI4qAqH/2Sj7SH4WFi |
|
1917 |
id2LU0xHOlFCRgAzGVIfnGnAh0KLAAqECnEjR3In46cvvDk61uD+OWrdBbbxB1CEuiyWjlsUFXAi |
|
1918 |
fPmNHUd+RWihHj0UoeOp5DIvbMkWfjYr9Cqf+3MclAFKYqLYVUl+JSOGNTEwv/KJvSMFS9rWI/VF |
|
1919 |
ejlkWMQpOKe3Ozi8LxfDGycGtQ4j9Npdy21XHfnkwQaDpzLuJJgPvko2oPvLpo54JYdFfvgg2m6o |
|
1920 |
90PEQkBoqvfBoxDTMb+FO9anBTxIDQ0LPbzfduzC8toYR9bax84Bo9C+0B7svILQrFa0LeOc7DO+ |
|
1921 |
qPUCWoN71Jr8kX2qa3bs74EjW05OyALlwV2Q3txGukEnnTDik0N87DKlyvT2YIt+t5A3MgOjAUY2 |
|
1922 |
woMHv9qDB+PYplMGS7K+GLvz7fl2GDd602J2aE5GoGemSli/OJf1AaIzmPG5C7MWGVzqX3RIkuTX |
|
1923 |
5CW/+fvpRLx5/xP8+1p+AFOKJwcn4h+AhnhTVBBf8tFXupMAD1XUHDgWjcLjhQSNtir4+gZ02849 |
|
1924 |
OuO2iD7t4R/zsJpSYIFrteY7QwBFniAdB2/9BHOGAX6bQ1Ydb9R4ikOLMtIvkQa7z53gWY0D3TJe |
|
1925 |
1esM7YWTJWlX82J0dvrm5P3Hk7i+RQ43P0dOFsWvjcLp6D3iCvfDJsI+mTf45NJxnH+QWTngN+ug |
|
1926 |
05xhwaBThBCXlDbQ5PsoEhtcJBVmDkS5XRTzGFsCy/OxuXoDjvTYiS/vNfSelUVY0VjvorXePD4G |
|
1927 |
aohfuopoBA2pj54T9SSEkhme3+LH8WjYFE8Epbbhz9PrzcLNjOuDODTBLqbtrCO/u9WFK6azhmc5 |
|
1928 |
ifA6sstgzmZmaaLWs7l7Zu9DLvR1IqDlaJ9DLpMmq4XMQXIpyKd7HUDTu8fsWEKYVdic0dkzStNk |
|
1929 |
m2SrnCKkRIkRjjqio+m4IUMZQ4jBf0yu2R7g+T/R8EFigE6IUvxUOF1VM1+xBHNIRNQbKDzYpPlL |
|
1930 |
t55HU5gH5Qh53jqyME90GxmjK1nr+fODaHzxvK10oKz03DtkOy/B6rlssgeqs3z69OlI/Mf93g+j |
|
1931 |
EmdFcQ1uGcAe9FrO6PUOy60nZ1er79mbNzHw43wlL+DBJWXP7fMmp9TkHV1pQaT9a2CEuDahZUbT |
|
1932 |
vmOXOWlX8UYzt+ANK205fs5TujQIU0sSla2+ewnTTkaaiCVBMYSJmqdpyGkKWI9t0eD5OEwzan6R |
|
1933 |
t8DxKYKZ4FvcIeNQe4UeJtWyWu6x6ByJEQEeUW0Zj0YHjOmEGOA5Pd9qNKeneVq3RzueuZun+iB9 |
|
1934 |
be8C0nwlkg1KhplHhxjOUUuPVVsPu7iTRb2IpZhfuAnHziz59X24A2uDpBXLpcEUHppFmheymhtz |
|
1935 |
iiuWztPaAWPaIRzuTFcgkfWJgwGURqDeySosrETbt3+y6+Ji+oH2kffNSLp8qLbXSnFyKMk7BYZx |
|
1936 |
3I5PaShLSMu35ssYRnlPaW3tCXhjiT/ppCrW9Xu3X7hHDJtc32rB9RvtVRcAh25SsgrSsqOnI5zr |
|
1937 |
uyx8Ztodd1Hgh0J0wu0mreomyab68oQpOmxTu7Gu8bRH0+48dGm9FXDyC/CA93UVPTgOpsoG6YlF |
|
1938 |
sOaUxJFY6hRF7J728g9GlQV6eS/YVwKfAimzmJozyiaJdGHZ1R7+1DWbjopHUF+ZA0U7PHNzkqV3 |
|
1939 |
CMTFfEJ1TuYIwg4v2uDSvVNCfHckoucT8edOIDQvt3grEqD8ZBE/WYS+T0ZdLw5ftHamH3h2IOwE |
|
1940 |
8vLy0dPN0hlNLxwq/76/ry46xABwDbKzTOVi/4lC7BjnL4WqobTz2s0pNGM8Hb5nq570wej2uAid |
|
1941 |
CpuBV79pFYqjWoz/aQcxJ661HuDDqSi0bIHsgXpTeNIp/rOXnmFhoEbPX1n0XKZDm1P4DS8ugfea |
|
1942 |
oK6js3PTUle4W7ADMbk+xshbUG3DluPv9ageJUrdGvFeK9yebCXOZf1H8HBIl7wQ03zV2Rb+I5mH |
|
1943 |
i/Z3bS72sPzm67vwdBXM4ImFgQX1FtNp9Qcy9U6WfezCPGC//n7+fzjv38X3j6aS7jVMKwylsJB5 |
|
1944 |
lfAbNIlNeWhTDUYl4FZQ5Ja34ae+HjwTw+oAdWN9Hd41fe5/19x1i8DO3Ozu9ubun31zaaD77uaX |
|
1945 |
IRpwmKcJ8aCa8VZgh3WBK8YTXVQwnLLUHyS/2wlnukMr3AfGlDBgApTYVGNvtPY6mbvfsUJmn693 |
|
1946 |
dY86DtqKzrR7Zz+7HP8QRc/VAPjcnn6mEo+F5kD2G+m+rikXDU7l1ZWaJnhX3JSCDSpw6XmRxn19 |
|
1947 |
R1d9yURtjdeJF6oACMNNuhTRrTYGxoCAhu+s5foQ5+YMQUNTFaVTlqnSBWeQtIsL4GLOHFF/k5nk |
|
1948 |
uspRJjHhp5qqrCAqGOmbTblwYajWswVqEhnrRF0b1E2Pib7oEofgahlzPJLzVRxpeNQBQvCpKefa |
|
1949 |
Ji5Unk7tO+CXZ+0x8HRiGULmzVpWSd1egeJvk6biO2cEOhSLC+ykKlrJ7HCKi1hq+cNBCpMF9vtX |
|
1950 |
2sn2gow7zn6PrdZ7OFtRD50Ce8yxcsf2GG5Ob+0VaO7VOwu6MNc18rZZy3322hdYCnOfF+lKnTvg |
|
1951 |
t/qOIb65kjOb6CY4fARy7x5J88tzrVpjJ8Wi4TxzFUP/Uhk81Uy2eOiuuB4X9G+F6wQadnxfb1hm |
|
1952 |
6YUmOxpbKmrXalDxtKON24gaK+nuiaj9aulHRtQe/AdG1PpmPzA4Gh+tDwbrp+8JvVlNuNfktYwA |
|
1953 |
faZAJNzZ61yyZkxm5FYjQ9ib3o7sNbWsM50jTsZMIEf2708iEHwdnnJLN73rqu6KqH3posffn314 |
|
1954 |
fXxGtJieH7/5z+PvqVoF08cdm/XglENe7DO19726WDf9oCsMhgZvsR24d5IPd2gIvfe9zdkBCMMH |
|
1955 |
eYYWtKvI3Ne7OvQORPQ7AeJ3T7sDdZfKHoTc88908b1bV9ApYA30U642NL+cLVvzyOxcsDi0OxPm |
|
1956 |
fZtM1jLay7XtWjin7q+vTrTfqm8q3JEHHNvqU1oBzCEjf9kUsjlKYBOV7Kh0/+cBVDKLx7DMLR8g |
|
1957 |
hXPp3DZHF80xqNr/vxRUoOwS3Adjh3Fib/yldpwuV/Yqa9wLm8vYEMQ7BzXqz88V9oXMdlAhCFjh |
|
1958 |
6bvUGBGj//QGk92OfaLExT6duNxHZXNpf+GaaSf37yluutb2TiLFlRu87QSNl03mbqTaPr0O5PxR |
|
1959 |
dr5YOiX+oPkOgM6teCpgb/SZWCHOtiKEQFJvGGLVINFRXyjmII9208He0OqZ2N91Hs89jybE890N |
|
1960 |
F50jb7rHC+6h7umhGnPqybHAWL6266Cd+I4g8/aOoEuIPOcD9xT13bfw9ebi+aFNtiK/42tHkVCZ |
|
1961 |
zcgx7BdOmdqdF9853YlZqgnVMWHM5hzT1C0uHajsE+yKcXq1+jviILPvy5BG3vvhIh/Tw7vQe9TF |
|
1962 |
1LLeIUxJRE/UmKblnG7QuNsn4/50W7XVB8InNR4ApKcCARaC6elGp3Juy+Wv0TMdFc4aujLUzbiH |
|
1963 |
jlRQFY3PEdzD+H4tft3udMLyQd0ZRdOfG3Q5UC85CDf7Dtxq7KVEdpuE7tRbPtjhAvBh1eH+zx/Q |
|
1964 |
v1/fZbu/uMuvtq1eDh6QYl8WSwKxUqJDIvM4BiMDejMibY115EbQ8X6Olo4uQ7VzQ75Ax4/KDPFC |
|
1965 |
YAowyJmdag/AGoXg/wBaZusT |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1966 |
""") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1967 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1968 |
##file ez_setup.py |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1969 |
EZ_SETUP_PY = convert("""
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1970 |
eJzNWmtv49a1/a5fwSgwJGE0NN8PDzRFmkyBAYrcIo8CFx5XPk+LHYpUSWoctch/v+ucQ1KkZDrt |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1971 |
RT6UwcQ2ebjPfq6195G+/upwanZlMZvP538sy6ZuKnKwatEcD01Z5rWVFXVD8pw0GRbNPkrrVB6t |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1972 |
Z1I0VlNax1qM16qnlXUg7DN5EovaPLQPp7X192PdYAHLj1xYzS6rZzLLhXql2UEI2QuLZ5VgTVmd |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1973 |
rOes2VlZs7ZIwS3CuX5BbajWNuXBKqXZqZN/dzebWbhkVe4t8c+tvm9l+0NZNUrL7VlLvW58a7m6 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1974 |
sqwS/zhCHYtY9UGwTGbM+iKqGk5Qe59fXavfsYqXz0VeEj7bZ1VVVmurrLR3SGGRvBFVQRrRLzpb |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1975 |
utabMqzipVWXFj1Z9fFwyE9Z8TRTxpLDoSoPVaZeLw8qCNoPj4+XFjw+2rPZT8pN2q9Mb6wkCqs6 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1976 |
4vdamcKq7KDNa6OqtTw8VYQP42irZJi1zqtP9ey7D3/65uc//7T964cffvz4P99bG2vu2BFz3Xn/ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1977 |
6Ocf/qz8qh7tmuZwd3t7OB0y2ySXXVZPt21S1Lc39S3+63e7nVs3ahe79e/9nf8wm+15uOWkIRD4 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1978 |
Lx2xxfmNt9icum8PJ8/2bfH0tLizFknieYzI1HG90OFJkNA0jWgsvZBFImJksX5FStBJoXFKEhI4 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1979 |
vghCx5OUJqEQvnTTwI39kNEJKd5YlzAK4zhMeUIinkgWBE7skJQ7sRd7PE1fl9LrEsAAknA3SrlH |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1980 |
RRS5kvgeiUToiUAm3pRF/lgXSn2XOZLFfpqSyA/jNI1DRngqQ+JEbvKqlF4XPyEJw10eCcY9zwti |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1981 |
6capjDmJolQSNiElGOsSeU4QEi8QPBCuoCyOpXD8lJBARDIW4atSzn5h1CNuEkKPhBMmJfW4C30c |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1982 |
n/rUZcHLUthFvlBfejQM/ZRHiGss44DwOHU9CCKpk0xYxC7zBfZwweHJKOYe96QUbuA4qR8F0iPB |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1983 |
RKSZ64yVYXCHR2jIfeJ4YRSEEeLDXD9xHBI7qfO6mF6bMOZ4ETFKaeLEscfClIQ+SQLfJyHnk54x |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1984 |
YsJODBdBRFgCX6YxS9IwjD0RiiREOgqasPh1MVGvTSJQSURIJ4KDPCaiwA0gzYORcPhEtAEqY994 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1985 |
lAiCGnZ9jvdRRl4iYkpCGhJoxMXrYs6R4pGfypQ6EBawwAvS2PEDLpgnmMO8yUi5Y99EAUsD6VMZ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1986 |
kxhZ6AuW+MKhHsIdByn1XhfT+4ZKknqu41COMHHUBCQJzn0EPgqcJJoQc4Ez0nGigMqIEI/G3IFa |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1987 |
8GyAxHYSN2beVKAucCZyIzf1hGB+KINYIGpuxHhEXA9SvXhKygXOSDcBQAF8uUSqEC9MWQop0uUx |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1988 |
jRM5gVbsAmeEI3gcRInH0jShksbwdOIgex3EPHangu2Pg0SokG4kOYdhYRi6QRK4LAZ+8TRJo3BK |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1989 |
ygVaUYemru8SRqjvOXAGcC6WQcBCAEXsylel9BYhSST2jHggqfRRUVSmQcQcuAqoJ6YSJhhblCi0 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1990 |
BvD7HuM0ZbFHmQwAX14kvYTIKbQKxxYJkUqeOFAHBYmMlb4ApocxAIMnbjQV6XBsEZHAKi7BKm7s |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1991 |
uELAuTHIKaQMhEeiKZQJL2KUcF9GAISAMUKS2A2QONyPKWPc5yGfkBKNLULBJGD5xHUjMFGSBLEH |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1992 |
EWDMMEhR2lPAGV2wGwsjIsOYwr/oHlANkQNDgsBHgYVkChuisUXUkwmJQw9kD9ilPkjaQai5CCVa |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1993 |
idCfkBJfwJ2DGMmUcOaTyA1F6LohyhAtRQIInMyX+IIJSCLTMAALcGC5I2kUM+lKD2HAI2+qAuKx |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1994 |
RQE4lgBvJVoGFGDgB67rSi4S38W/eEqX5KIbclQv5KXwSMrBHyoFAeCJ76jGynldSm8Ro8RPgA3o |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1995 |
OYLEZ47KWWQbnM3ALJM0kIwtcmPPjQFyCHTKmRs6YeqQMKG+QJ2n4VSk07FF0J0FDpoZV3mYBmkk |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1996 |
AiapcBLYypypSKcXyIAkQ2MHbvWThEdAJyKEEwG8WOQHU/1dK6W3SAqE1hchcWPqegxhYmHg0hjc |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1997 |
C+YXU0ySjvmIEZSNKxVqEk9wAJOb+mC2mIaphx4HUn6dDSYCjDf1rKlOd2bg2pF6l2e0m7fQu8/E |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1998 |
L0xg1Pio73xQI1G7Fg+H62ZcSGv7heQZun2xxa0ldNoWmAfXlhoAVnfagExa3X01M3bjgXmoLp5h |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1999 |
tmgwLigR+kV7J34xdzHfdcsgp1351aaXct+JfjjLUxfmLkyD79+r6aRuuKgw1y1HK9Q1Vya1FrTz |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2000 |
4Q2mMIIxjH9lWcu/lHWd0Xww/mGkw9/7P6zmV8JuejNHj1ajv5Q+4pesWXrmfoXgVoV2l3HoxXCo |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2001 |
F7Xj1eZimFv3am0pqcVmMNCtMSluMapuytpmxwq/mWTqX+AiJ6eNG87aIGFs/ObYlHv4gWG6PGEU |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2002 |
Lfhtb/bgpEDN9XvyGbHE8PwFriLKQXCeMu1Amp0Z5x9bpR+telcec66mWWJ8PZTWTebFcU9FZTU7 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2003 |
0lgYhHvBWpaagAvlXUti6u2VOhZcvyKsx5EjHi010i6fdxnbdbsLaK2OJow8a3G7WNlQ0njpUW2p |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2004 |
5AyOMXaiGh2QPGeYuek5EwRfIyNNgmuVixL+yCtB+OmsPvb4KAfqabfr7dqzCS2mabXU0qjQqrQO |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2005 |
0ScWrCx4bXzTqXEgSBTlVHhElVXWZAhd8TQ4zzARb+0vC6HPE8zZCDd6wallrnz44vmI0rI9bBCt |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2006 |
MH2WU5VH7CSMKqbOiLUXdU2ehDngOBfd46POl4pktbB+PNWN2H/4RfmrMIEoLNLgnjnZIFRBizJe |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2007 |
paAyxpx62F2G6p/PpN4aFIL9G2tx+Py0rURdHism6oVCGLX9vuTHXNTqlGQAoJePTU2g6jjyoHXb |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2008 |
cnVGEpVym3PRDOqy9dhFCXZlt74otDMGdEViw7OiapbOWm0yALkWqPud3g1Pd2h3zLdtA7PVwLxR |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2009 |
MkyAAOyXskYO0g9fQPj+pQ6Qhg5pH13vMBJtt8m1nJ81fr+Zv2ldtXrXyh6qMBbwV7Py27KQecaa |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2010 |
QRxgokFOBstluVzduw9DYhgmxX9KBPOfdufCmCiF5fvNTb3qy7wrb33K+akYc8GckWLRqGrrqwdw |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2011 |
ok72dPm0J3mqkI5FgSy3rb/kAsnTLb+Sp8pLVTmwScCWTkOZVXWzBmGoSllAwqnLCuvtzwPlF/aF |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2012 |
vE/Fp2L57bGqIA1IbwTcVBeUtgKhndNc2KR6qu+dh9fp7MWwfpchZzN6VBT7fdn8qQRwD3KI1PWs |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2013 |
LcR8/OZ6WKv3F5X+oF75Gk7RXFB+HtHpMHsNr75UxL83uapSR6aOWPW7FyhUFy05U4CVl8w0IBos |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2014 |
jQ1ZY86DdUPxX0qpBpDViX9Hqb/FqOqe2vWaTg3KP54ZcoIFS8N9HfUpCmHNkeRnI1pKGdNG94FC |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2015 |
BWahHjJrh3zMTdJ23enGGkDX25sanfZNrRrt+bAWLg68TeJD7pAplM+sN+OGsCZfBLTfoAE3FPD3 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2016 |
MiuWHWF0S424umJKnO6Kvwd3d420Qp/uddRd3dRLI3Z1p4rhmy9lphLoIIhix06dui+2EXqrS6ci |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2017 |
hyDljbrzUl4+jVap1lvFZfyuurDSfiZVsVR+fvv7XebzkBYrW3CuX8ryG50S6nOSpfgiCvUHzDlA |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2018 |
2dlO5AfV5X002TboNPpUQSui8l99krNUrpgB5dcWoGqmbu1RzoWAI/EK6lD1uQBd8awglmB4rWv9 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2019 |
9hDWNSjbs3ZLoHHb0Zx3hMq8y2Z7NlsCEcWd8rAWsydsp5orXgrDNTuEF0o0z2X1ud10bR0MYZS0 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2020 |
Ie2ncAopNErcAEwVisADTPfoegEknyuxrZxKtAQ0NMBe/Z5RRFKsr1JmALpX7ZPOsrWqpqvX0D/o |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2021 |
ZG0yNUe2bVIuxOGd+bG86LTG2dnBsKa6eq63uKAyXXItPtj4WR5Esbxa9rX1A1r82+cqawA+iDH8 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2022 |
q5trYPjntfog8FlFT3UArFJlCGhkZVUddXLk4kKYjvswPVTP3Qi9vsPE7mo/VJsauWGArcaP5Wqs |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2023 |
sUERbY3BivX8mc7hTjywtR1m6O5fwuinRsC7SwjABnd6F5aXtViuriCibu600OHzls060IKCufql |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2024 |
g63Zv3Mp/t4j05foQb6spxj7zLkfX/uIVHPsB3RL7aqOIF5qnS8+en6tbzajQo/VVxLPa14fJ/Rc |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2025 |
7lx3WeOhYTQz6Jip0hhMCqzc72GoPWoLu8Mb0o5f3dXGSLs4BxdoP6/eqLOVh5VO02exqHRaC0vR |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2026 |
+G+mirJU+fmCq5Ta1xyCRccC897nZW+WyGsxiMawF7e329Zb2621wQDo2I7tLv7jrv9/AfAaXNUU |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2027 |
TOsyF6jViUG46+NBJqZXv+rRK7Evv2i81ZEw33DQ8y6YowH05r+BuxfN92SX3RbVP8bNymDOGnY7 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2028 |
16PfvzG+4ecrzfzkjPZya/H/ScnXyqwX/JtSrrL5pbrryu1hPKFrZzsrJD6sUuyPwDGdKerJyxmq |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2029 |
dvmdHNCrrzU/+2W0pQ6gSvPl/Mertmi+7hBlDhB80kRUqcNeJCGapHNCz1cvCFwsf0A/Ne++jGMf |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2030 |
TuOJcm6+ZnP9TRR7tWjHreOhZ6huiKnPAP2zfmqpIqHHLG/emnNhyHxSs+JJYfIwj6t2AlLdVneO |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2031 |
3Is9u0R33ef+Wv2pVizPfbUW0rGhps1FRRfnZ/2xsnr3oT2Slh2tvngsLXu6M0OgIen7ufrjprrD |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2032 |
vzXQAgNE22ualqzbyAb97uvl6qF/2a5hcU+eBzVWzOdmVjA0PXQMQoAhsulmBv39oU13134SjSlb |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2033 |
dX85nKW3umfYbtu8713Sylhb2i3v2qaoc8C7S2P3pME8uIGedi1IxXbL+adi+P2fT8Xy/m+/PrxZ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2034 |
/TrXDcpqOMjotwdo9AJmg8r1N7BySygc+Gp+XaYdJhpV8f/7Oy3Y1s330l09YBDTjnyjn5qHGF7x |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2035 |
6O7hZfMXz21OyLZB6lUfOGAGMzo/bjaL7VaV7Ha76D/1yJVEqKmr+L2nCbH7+959wDtv38JZplQG |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2036 |
BDaonX65d/fwEjNqlDjLVIvM9X+XVxF7 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2037 |
""") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2038 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2039 |
##file distribute_setup.py |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2040 |
DISTRIBUTE_SETUP_PY = convert("""
|
| 6 | 2041 |
eJztO21z27jR3/Ur8MjjIZVKtJ27XjueRzeTuzhXz6VJJnZ6HxIPDZGQxDPfDiQtq7++uwuAAF9k |
2042 |
O722M52p2nMkYrFY7PsuwKP/K/f1tsgn0+n0h6Koq1ryksUJ/JusmlqwJK9qnqa8TgBocrlm+6Jh |
|
2043 |
O57XrC5YUwlWibop66JIK4DFUclKHt3xjfAqNRiU+zn7talqAIjSJhas3ibVZJ2kiB5+ABKeCVhV |
|
2044 |
iqgu5J7tknrLknrOeB4zHsc0ARdE2LooWbFWKxn85+eTCYPPWhaZQ31I4yzJykLWSG1oqSX47iN/ |
|
2045 |
NtihFL81QBbjrCpFlKyTiN0LWQEzkAY7dY7fASoudnla8HiSJVIWcs4KSVziOeNpLWTOgacGyO54 |
|
2046 |
TotGABUXrCrYas+qpizTfZJvJrhpXpayKGWC04sShUH8uL3t7+D2NphMrpFdxN+IFkaMgskGvle4 |
|
2047 |
lUgmJW1PS5eoLDeSx648A1SKiWZeUZlv1bapk7T9tW8H6iQT5vs6z3gdbdshkZVIT/ubS/rZygtR |
|
2048 |
VkZQabGZTGq5P7cyrRLURTX86eriY3h1eX0xEQ+RgI1c0vMLZLia0kKwJXtX5MLBZshuVsDQSFSV |
|
2049 |
UpxYrFmoTCGMsth/weWmmqkp+MGfgMyH7QbiQURNzVepmM/YH2iohZPAPZk76IMI+OsTNrZcstPJ |
|
2050 |
QaKPQO1BFCAokGnM1iATRRB7GXzzLyXyiP3WFDWoFj5uMpHXwPo1LJ+DZloweISYSjB+ICZD8j2A |
|
2051 |
+ealZ5c0ZCFCgducdcc0Hg/+B6YO48Nhh23e9LiaeuwYAQdwGqY/pDf92VJArIMvesXqpi+dogqq |
|
2052 |
koMN+vDtQ/jLq8vrOesxjb1wZfb64s2rT2+vw79dfLy6fP8O1pueBt8FL/88bYc+fXyLj7d1XZ6f |
|
2053 |
nJT7MgmUqIJCbk60S6xOKnBbkTiJT6yXOplOri6uP324fv/+7VX45tXPF697C0VnZ9OJC/Th55/C |
|
2054 |
y3dv3uP4dPpl8ldR85jXfPE35ZzO2VlwOnkHXvXcMehJO3pcTa6aLONgFewBPpO/FJlYlEAh/Z68 |
|
2055 |
aoBy6X5fiIwnqXryNolEXmnQ10K5E8KLD4AgkOChHU0mE1Jj7Xl88AQr+HduXFGIbF/6s5kxCvEA |
|
2056 |
ISkibSXvr+BpsM5K8KDAA+Neguwuxu/gyHEc/Eiw4zL3vQuLBJTiuPLmerICLNI43MWACPRhI+po |
|
2057 |
F2sMrdsgKDDmLczx3akExYkI5dOCohS52ZaFCfU+9J47k4MoLSqB0cda6KbQxOKm2zjRAoCDUVsH |
|
2058 |
okpeb4NfAV4TNseHKaiXQ+vn05vZcCMKix2wDHtX7NiukHcuxwy0Q6UWGkapIY7LdpC9bpXdm7n+ |
|
2059 |
JS/qjkfzTECH5TyNHL6+cJWj52Hselegw5AowHI7cGlsJwv4GjfSqI6bygQOHT0sQhC0QM/MMnDh |
|
2060 |
YBWMr4p7YSatkxzwjGmGUiSLWsXKQGa1FKLVG20CqyYBcLHZ+PDfnLWWUBchgv3PAP4LDIBkSJE0 |
|
2061 |
ZyDFEUQ/tBCOFSCsFYSSt+XUIYNY/IZ/Vxg5UG3o0QJ/wR/pIPqXKKnan4qYRvekqJq07qoWEKKA |
|
2062 |
tTkbeYgHIKyiYUuD5Akkw5fvKe3xvR+LJo1pFvFR2d1mg3ambSSGLels2deJ97zNn8MVr4TZtvM4 |
|
2063 |
Finf61WR0X0l0fCeDcGL42pR7o/jAP6PnB1NUuBzzCwVmDDoHxDN1gVo2MjDs5vZ89mjjQYIbvfi |
|
2064 |
5PYH9n+I1t7nAJes1j3hjgiQ8kEkH3ypkLV/OmdW/jqz7lZYTjmxMvWlCf4hpfZLMhwl7141o3e8 |
|
2065 |
7KVfPQ4snRRslBtqB0s0gEaOMGF59sc5CCdc8zuxvJaNaH1vxskBVA2UgDtKzElH+aoqUjRj5MXE |
|
2066 |
LuFoGoDgv77LvR2vQsUlgb7WK+82IZgUZYQVJcjI36yIm1RUWJN9aXfjWa70AYd+uvPDEU1nvS6A |
|
2067 |
Us4tr3hdS78DCIYSxk78Hk3wcbbm4HiGT0PdWrsPop2DrYtaiEMlUztT5fW/x1scZl6HGYFuCPhT |
|
2068 |
y5Lvl1OosPR6sxHC+vvoYtRJ+Y9Fvk6TqO4uLkBPVGUSkT/xZ+BR+qJz9WrIfZwOoRDymWAnoYz2 |
|
2069 |
BxDTa/LttLHY7W84fSD/++UxlENJRaLm91AMUJ30JZ8O8WHbJuK5V2M1q40dMO+22JKgXo5uQcA3 |
|
2070 |
2eQYXwL2IRUgoFF8pk3BWVZIJDXCBM8Quk5kVc/BOAHN6HQPEO+N02GLT86+vGAE/kv+Jfd/bKSE |
|
2071 |
VdK9QsyO5QyQdyKACDAfxcxiqMxKaEntv+yOibQasRDQQdYzOsfCP/c8xQ1OwdhMTaTi7lCp/DX2 |
|
2072 |
8KwocshmRvW6zXZg1XdF/aZo8vh3m+2TZI6ROEiFHnNYYSQFr0XfX4W4ObLANsuiiPVIoP69YYs+ |
|
2073 |
I7FLhyztiKHcfm37ia29Umhtu5ZgfGkRUeVDPVXN+aRWbcKcZ0Jljbea9lvICik5W2Hv856nSQe7 |
|
2074 |
Mb28yVZCgklzsuXWLRAu7DVSVkwNmbbpCWpAUwS77fDjlmELxQcnEW3N6iKPVeTEhjBn3ok3C9it |
|
2075 |
4sktrtgpDsDBCClMFtm208wqIg7UHomD7XS9B2rnRkUeU2O15BjrV2KN/gZ7qFHd8NS2d2l/NZZa |
|
2076 |
dWDE8G/JGTrhiITaSKipVxSIBPbUdXNbplh3TRxzHA2XDoqXY3Przd9DVAfsLHXy4wDrtM3f0QNq |
|
2077 |
6asOuuykqyhICIYGi0oB+b0Alh7Iwg2oTjBlhOhgX7pz65hrL3VWaGfnyPNX90WCWl2i6cYtOTbJ |
|
2078 |
GUT1tn5prYecfDWd45a6PlsRpbnkD4aP2EfB4xMKrgwjDORnQDpbgcndzbGdv0MlxHCofAtoclRI |
|
2079 |
Ce6CrK+HDHZLWm3sJcGDlVoQvFFh88GeH2YIMgJ94HEvqVJsJKIVs+ZsultNB0A6L0BkdmzgNLUk |
|
2080 |
YK2RHAMIMDV8Dx7wj8Q7WNSFt41ZkjDsJSVL0DI21SA47Arc16p48NdNHqE7016Qht1xat/O2YsX |
|
2081 |
d7vZI5mxOlywNYqebizjtXEtV+r5Y0lzHxbzZii1xxJmpPY+KVQratDGdz8lr6rBQH+lANcBSQ+f |
|
2082 |
t4s8A0cLC5gOzyvxWIfKFyyUnpHa2AlvOAA8O6fvzzssQ608RiM6on9SnfUyQ7ofZ9CoCEbTunFI |
|
2083 |
V+tdvTWaTmSF6B18NIQ5OAzwAXltg/4vFN14dNeU5C/WKrcWudoSxHYTkshfgncLNQ7jExDxzPUb |
|
2084 |
wI4h7NIsbVl0BF4Op+0N90baXq+6EG6/VW/bqoOd9QGhsRoIzARIKDE6hOQOiGKV0rmbAEvbeWPh |
|
2085 |
Ujs2w7vxZHA95olIuSeOGGA91704I613wkNsw7dRqRkv12e+w2SDa7BrhSEXOxOd8SlEWi94//Z1 |
|
2086 |
cFzhqRkewAb4Z9D+/YjoVIDDYFKoxqOi0eDUnWAscfGnPzaqd2AeWmqz4h5SZjCP0O2y+2XKI7EF |
|
2087 |
hRemn92L5UmFHckhWJf8T/kdRMNOAx+yL70JZ+5hFVtj9dHxQZiTmisITrt4nBSgWp9oB/pfH+fO |
|
2088 |
3b7MC+wcLrBE6Lt8s/jAY65A/ncuW9bdIslywHZKKY93j+nddXsMmAzUAOSEaiBSoY59i6bGzBcd |
|
2089 |
yI7vrdmZaqeftTnsmTOl/Zr8nkT1fIcT1qFr4wGyww6s8ladKDKYpFyinjFnI2eiuv+tOTrw75Yb |
|
2090 |
YAu876XmrEvNqDIdAeYdS0XtVQwVv/W/fX62iqb5jbrmu628ea8JqBv9eNsBvzrcMxgek4eG6Zyw |
|
2091 |
9fvNGqRX87ruZoBlGNfH9BL8qmrgA1sNsZoTB9rp3pW9OhQ7zQKvt5OuSz7ka/oO+hBc6675GpLq |
|
2092 |
9hwaCdBccYIYgrSXZNr+dWsklvlYtAAGPDyDEJBlQEVYrH7120PMWWCa3iUUhlB9qej2VLOh4900 |
|
2093 |
4V8zp+N0XXpBKUdqqqcc8Yi4DXdMf2HohIhV+3tiEhidDlb+s89PVGFoN6rDsWNH+vimsp4QFvjS |
|
2094 |
0Tr/0IWEuaLtK9xej5SBBzS8HLrAUd+jwB/xPB1/BovwCC8WOU4Qnv0Svv95bCGobrHu3EIdxUoh |
|
2095 |
s6SqzN0xVa8eY6vxLilLCAtTl4aeKfyISqcyiAGpNhlrSXo8IRv12gRwODlT8qnbbOywfBzFCGCC |
|
2096 |
10+Gelupt44Y7Vb046e20iHD6dL1leTp/T1l1z0H9yz/MZl1C4o25NqU8kgHMoh/0R1qWYK/xhL8 |
|
2097 |
g8ahUvCLn35aoCQxgIFU1fevMI5kkEI/GuUPRaTnRnVrX05kP1BtAPHZXcu37qNHWTF7wq08ybn/ |
|
2098 |
iGk5rOjUPVpbxksfPWhvs1CvtI2ng1j6g+qlHgymIweEGjM1jMNSinXy4JswYyNbG2LJP+qzUS43 |
|
2099 |
9861A2dz+FvfGTSAn80XiNGxeHCCNhRYZ+c3bRpHw3Nzt1DkTSYkV7cO3QYOgqpLuirhWywk7FZd |
|
2100 |
11Db6FcIsA3AEcCqsq6w2Y16vMQopvCMdIfqotTCoZllmtS+h+ssvdnnRe+Q0GGCYaC7mMbVP6lS |
|
2101 |
VGF1qqgYPflNQTnVVcnvFX/GG1kdcqvPBIncHdL5tbRaKoG9TSWkR0cc9g6wPrPEdvJo42hslXb2 |
|
2102 |
iHUorRyoa1/hryJOJ5vOAai5BTpmwAfP6B9rlB2xnfDAqiIgYSTLcBJsUEnn+lFcCMWUSogMkwH3 |
|
2103 |
nHbYq6GfOzSZbrWiL0ghG4YbcsIRpsYweVcFmDZ2D6C7GD+qU2hM/sFPSnBP3XJJCgr1OL4kt93V |
|
2104 |
2ZnLset9KQb8wk6pc5D16sPlv5NgS52tSvvLgHp2VdO9hOa+XuHWSKpTMC6oIxaLWujLfhjP8YJA |
|
2105 |
GxRRb+N+St0eDi775AVmqK/d7msfThWmlgZdN/2ZkVU0L+ioQ/lGVE/yjckDEVvK4j6JRazeAEnW |
|
2106 |
Gt5916RyuiGxvieYze1Ri+mCuslzN5SMUTYuBY0NGDrvEwyI1AnN2F3XoW9T1+CBli2UQ4dLpk5m |
|
2107 |
Bjaq5Fi5twz1lkY2EYg81kGELrMd2FS+UJcQrfA6dKC1H27sjUrVTNakAY4xfzvS5XHuqR4m6VAS |
|
2108 |
NULK4zmVJtE/lJKiznXbI1+Rlh7MSx9piPd40503bIm7utEeKKJZ06m38pB0Au14/1z0RdstCH6v |
|
2109 |
PHv00hlsLpwmfsqbPNrapM4+6cfNj3qks2cMdKqKpZeyFAT1H8xrPAqqTEqWcXmHNwwKxulYmNsJ |
|
2110 |
q2aj66YMe4qfvUXUvWkOKQTe9knFQnchFuKBXtuC1HmR8Ryid+zdtK7cJJDn39xgAoJonQBoRk9v |
|
2111 |
2nYFdvXcFPRz97WTG0iJzLSJwUHXiEbfKGq56dytrkS6Vq395TSAij4TeL2hWmKMsadH+j44HVdr |
|
2112 |
CHUWSlcVJHBfsRp/RuomlLkObfZnr12gj8bX34pdjvV3VsT4opyKB3gcQQBu98GeKxokCSglNeRA |
|
2113 |
B+IqYLe4Aa+9voJvrQHStSBCBrfBgVDNAfgKk/WOPPTMKnXlKRGR4VuIdKUF+EkkU4fS4MFDAK3V |
|
2114 |
oMGrPduIWuPyZ917Hjpdi4py7/6GWg0qAn11UTFU3Yo3AJrx9n6jywHQh5s2TzBiGeQHZgBjdbqe |
|
2115 |
tNUJrET+ESKMBukU13pYN+h7furIENahR1+7qfhaoFRF7/KBhQx4CUVq7Os1uq7N0LUkbgX451FA |
|
2116 |
vPaGHZ5vv/2zSmaiJAP5UVUFBJ7+6fTUydnSdaBlb5Aq7W+TjI8CTVmwCtnv0uxasdtzZP/P/Jdz |
|
2117 |
9q3DIjQynC+kDxjO5ojn5Wy0moiykmACbCQowMAeoPX5hkh9hXkcQCrq/bHDkQGiO7FfGg0M8FIC |
|
2118 |
6C/S7CEB3gzTZ8KmLjkbBkEqR/dRAFdrwq3Zou6SPDC36zOvp3XOeIdIOqocbX0YiXcZNDjhJylH |
|
2119 |
WyDOyljjnQ0BGzoCfQZgtIWdPQKo6wjXZP+J27lKRXFyCtxPoUw+G5bIdPe5V36P3aYgZGG82vig |
|
2120 |
hFPtW/B9PryXJXqvFrlvTWHAuDdNE+e58jn4FEvn9pKsU0yrtyjvjbV0wMjzj5vPd6PtaIXUXDau |
|
2121 |
2Afzhut3mFFDziekcz9J3Qi/2le1yC4wCp7Nxshw3JyzM+OTzEY6lbwLqJmW8YQ6GfdzduACpw2f |
|
2122 |
l4+9N01cueDVXkOZkPH42x06Uxq8F3lQlijshG49YXYaUgMkDHEXYajf0KUttWnI2fnNbPIPtwCg |
|
2123 |
9g== |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2124 |
""") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2125 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2126 |
##file activate.sh |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2127 |
ACTIVATE_SH = convert("""
|
| 6 | 2128 |
eJytVVFvokAQfudXTLEPtTlLeo9tvMSmJpq02hSvl7u2wRUG2QR2DSxSe7n/frOACEVNLlceRHa+ |
2129 |
nfl25pvZDswCnoDPQ4QoTRQsENIEPci4CsBMZBq7CAsuLOYqvmYKTTj3YxnBgiXBudGBjUzBZUJI |
|
2130 |
BXEqgCvweIyuCjeG4eF2F5x14bcB9KQiQQWrjSddI1/oQIx6SYYeoFjzWIoIhYI1izlbhJjkKO7D |
|
2131 |
M/QEmKfO9O7WeRo/zr4P7pyHwWxkwitcgwpQ5Ej96OX+PmiFwLeVjFUOrNYKaq1Nud3nR2n8nI2m |
|
2132 |
k9H0friPTGVsUdptaxGrTEfpNVFEskxpXtUkkCkl1UNF9cgLBkx48J4EXyALuBtAwNYIjF5kcmUU |
|
2133 |
abMKmMq1ULoiRbgsDEkTSsKSGFCJ6Z8vY/2xYiSacmtyAfCDdCNTVZoVF8vSTQOoEwSnOrngBkws |
|
2134 |
MYGMBMg8/bMBLSYKS7pYEXP0PqT+ZmBT0Xuy+Pplj5yn4aM9nk72JD8/Wi+Gr98sD9eWSMOwkapD |
|
2135 |
BbUv91XSvmyVkICt2tmXR4tWmrcUCsjWOpw87YidEC8i0gdTSOFhouJUNxR+4NYBG0MftoCTD9F7 |
|
2136 |
2rTtxG3oPwY1b2HncYwhrlmj6Wq924xtGDWqfdNxap+OYxplEurnMVo9RWks+rH8qKEtx7kZT5zJ |
|
2137 |
4H7oOFclrN6uFe+d+nW2aIUsSgs/42EIPuOhXq+jEo3S6tX6w2ilNkDnIpHCWdEQhFgwj9pkk7FN |
|
2138 |
l/y5eQvRSIQ5+TrL05lewxWpt/Lbhes5cJF3mLET1MGhcKCF+40tNWnUulxrpojwDo2sObdje3Bz |
|
2139 |
N3QeHqf3D7OjEXMVV8LN3ZlvuzoWHqiUcNKHtwNd0IbvPGKYYM31nPKCgkUILw3KL+Y8l7aO1ArS |
|
2140 |
Ad37nIU0fCj5NE5gQCuC5sOSu+UdI2NeXg/lFkQIlFpdWVaWZRfvqGiirC9o6liJ9FXGYrSY9mI1 |
|
2141 |
D/Ncozgn13vJvsznr7DnkJWXsyMH7e42ljdJ+aqNDF1bFnKWFLdj31xtaJYK6EXFgqmV/ymD/ROG |
|
2142 |
+n8O9H8f5vsGOWXsL1+1k3g= |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2143 |
""") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2144 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2145 |
##file activate.fish |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2146 |
ACTIVATE_FISH = convert("""
|
| 6 | 2147 |
eJyVVWFv2jAQ/c6vuBoqQVWC9nVSNVGVCaS2VC2rNLWVZZILWAs2s52wVvvxsyEJDrjbmgpK7PP5 |
2148 |
3bt3d22YLbmGlGcIq1wbmCPkGhPYcLMEEsGciwGLDS+YwSjlekngLFVyBe73GXSXxqw/DwbuTS8x |
|
2149 |
yyKpFr1WG15lDjETQhpQuQBuIOEKY5O9tlppLqxHKSDByjVAPwEy+mXtCq5MzjIUBTCRgEKTKwFG |
|
2150 |
gpBqxTLYXgN2myspVigMaYF92tZSowGZJf4mFExxNs9Qb614CgZtmH0BpEOn11f0cXI/+za8pnfD |
|
2151 |
2ZjA1sg9zlV/8QvcMhxbNu0QwgYokn/d+n02nt6Opzcjcnx1vXcIoN74O4ymWQXmHURfJw9jenc/ |
|
2152 |
vbmb0enj6P5+cuVhqlKm3S0u2XRtRbA2QQAhV7VhBF0rsgUX9Ur1rBUXJgVSy8O751k8mzY5OrKH |
|
2153 |
RW3eaQhYGTr8hrXO59ALhxQ83mCsDLAid3T72CCSdJhaFE+fXgicXAARUiR2WeVO37gH3oYHzFKo |
|
2154 |
9k7CaPZ1UeNwH1tWuXA4uFKYYcEa8vaKqXl7q1UpygMPhFLvlVKyNzsSM3S2km7UBOl4xweUXk5u |
|
2155 |
6e3wZmQ9leY1XE/Ili670tr9g/5POBBpGIJXCCF79L1siarl/dbESa8mD8PL61GpzqpzuMS7tqeB |
|
2156 |
1YkALrRBloBMbR9yLcVx7frQAgUqR7NZIuzkEu110gbNit1enNs82Rx5utq7Z3prU78HFRgulqNC |
|
2157 |
OTwbqJa9vkJFclQgZSjbKeBgSsUtCtt9D8OwAbIVJuewQdfvQRaoFE9wd1TmCuRG7OgJ1bVXGHc7 |
|
2158 |
z5WDL/WW36v2oi37CyVBak61+yPBA9C1qqGxzKQqZ0oPuocU9hpud0PIp8sDHkXR1HKkNlzjuUWA |
|
2159 |
a0enFUyzOWZA4yXGP+ZMI3Tdt2OuqU/SO4q64526cPE0A7ZyW2PMbWZiZ5HamIZ2RcCKLXhcDl2b |
|
2160 |
vXL+eccQoRzem80mekPDEiyiWK4GWqZmwxQOmPM0eIfgp1P9cqrBsewR2p/DPMtt+pfcYM+Ls2uh |
|
2161 |
hALufTAdmGl8B1H3VPd2af8fQAc4PgqjlIBL9cGQqNpXaAwe3LrtVn8AkZTUxg== |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2162 |
""") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2163 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2164 |
##file activate.csh |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2165 |
ACTIVATE_CSH = convert("""
|
| 6 | 2166 |
eJx9U11v2jAUffevOA2o3ZBG9gxjGx2VVqmlVUUrTWMyTnLTWEocZDsg+uvnOEDDx5aHKLn3fFyf |
2167 |
3HQwy6RBKnNCURmLiFAZSrCWNkNgykrHhEiqUMRWroSlfmyyAL1UlwXcY6/POvhVVoiFUqWFrhSk |
|
2168 |
RSI1xTbf1N0fmhwvQbTBRKxkQphIXOfCSHxJfCGJvr8WQub9uCy+9hkTuRQGCe08cWXJzdb9xh/u |
|
2169 |
Jvzl9mn2PL7jj+PZT1yM8BmXlzBkSa3ga0H3BBfUmEo5FE56Q2jKhMmGOOvy9HD/OGv7YOnOvrSj |
|
2170 |
YxsP/KeR7w6bVj3prnEzfdkaB/OLQS+onQJVqsSVdFUHQFvNk1Ra1eUmKeMr5tJ+9t5Sa8ppJZTF |
|
2171 |
SmgpopxMn7W4hw6MnU6FgPPWK+eBR53m54LwEbPDb9Dihpxf3075dHx/w/lgiz4j5jNyck3ADiJT |
|
2172 |
fGiN0QDcJD6k4CNsRorBXbWW8+ZKFIQRznEY5YY8uFZdRMKQRx9MGiww8vS2eH11YJYUS5G7RTeE |
|
2173 |
tNQYu4pCIV5lvN33UksybQoRMmuXgzBcr9f9N7IioVW95aEpU7sWmkJRq4R70tFB3secL5zHmYHn |
|
2174 |
i4Un70/3X5WjwzZMlciUNff39a5T/N3difzB/qM0y71r7H5Wv4DubrNS4VPRvDPW/FmM/QUd8WEa |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2175 |
""") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2176 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2177 |
##file activate.bat |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2178 |
ACTIVATE_BAT = convert("""
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2179 |
eJyFUkEKgzAQvAfyhz0YaL9QEWpRqlSjWGspFPZQTevFHOr/adQaU1GaUzI7Mzu7ZF89XhKkEJS8 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2180 |
qxaKMMsvboQ+LxxE44VICSW1gEa2UFaibqoS0iyJ0xw2lIA6nX5AHCu1jpRsv5KRjknkac9VLVug |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2181 |
sX9mtzxIeJDE/mg4OGp47qoLo3NHX2jsMB3AiDht5hryAUOEifoTdCXbSh7V0My2NMq/Xbh5MEjU |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2182 |
ZT63gpgNT9lKOJ/CtHsvT99re3pX303kydn4HeyOeAg5cjf2EW1D6HOPkg9NGKhu |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2183 |
""") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2184 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2185 |
##file deactivate.bat |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2186 |
DEACTIVATE_BAT = convert("""
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2187 |
eJxzSE3OyFfIT0vj4spMU0hJTcvMS01RiPf3cYkP8wwKCXX0iQ8I8vcNCFHQ4FIAguLUEgWIgK0q |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2188 |
FlWqXJpcICVYpGzx2BAZ4uHv5+Hv6wq1BWINXBTdKriEKkI1DhW2QAfhttcxxANiFZCBbglQSJUL |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2189 |
i2dASrm4rFz9XLgAwJNbyQ== |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2190 |
""") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2191 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2192 |
##file activate.ps1 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2193 |
ACTIVATE_PS = convert("""
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2194 |
eJylWdmS40Z2fVeE/oHT6rCloNUEAXDThB6wAyQAEjsB29GBjdgXYiWgmC/zgz/Jv+AEWNVd3S2N |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2195 |
xuOKYEUxM+/Jmzfvcm7W//zXf/+wUMOoXtyi1F9kbd0sHH/hFc2iLtrK9b3FrSqyxaVQwr8uhqJd |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2196 |
uHaeg9mqzRdR8/13Pyy8qPLdJh0+LMhi0QCoXxYfFh9WtttEnd34H8p6/f1300KauwrULws39e18 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2197 |
0ZaLNm9rgN/ZVf3h++/e124Vlc0vKsspHy+Yyi5+XbzPhijvCtduoiL/kA1ukWV27n0o7Sb8LIFj |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2198 |
CvWR5GQgUJdp1Pw8TS9+rPy6SDv/+e3d+0+4qw8f3v20+PliV37efEYBAB9FTKC+RHn/Cfxn3rdv |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2199 |
00Fube5O+iyCtHDs9BfPfz3q4sfFv9d91Ljhfy7ei0VO+nVTtdOkv/jpt0l2AX6iG1jXgKnnDuD4 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2200 |
ke2k/i8fzzz5UedkVcP4pwF+Wvz2FJl+3vt598urXf5Y6LNA5WcFOP7r0sW7b9a+W/xcu0Xpv5zk |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2201 |
Kfq3P9Dz9di/fCxS72MXVU1rpx9L4Bxl85Wmn5a+zP76Zuh3pL9ROWr87PN+//GHIl+oOtvn9XSU |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2202 |
qH+p0gQBFnx1uV+JLH5O5zv+PXW+WepXVVHZT0+oQezkIATcIm+ivPV/z5J/+cYj3ir4w0Lx09vC |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2203 |
e5n/y5/Y5LPPfdrqb88ga/PabxZRVfmp39l588m/6u+/e+OpP+dF7n1WZpJ9//Z4v372fDDz9eHB |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2204 |
7Juvs/BLMHzrxL9+9twXpJfhd1/DrpQ5Euu/vlss3wp9HXC/54C/Ld69m6zwdx3tC0d8daSv0V8B |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2205 |
n4b9YYF53sJelJV/ix6LZspw/sJtqyl5LJ5r/23htA1Imfm/gt9R7dqVB1LjhydAX4Gb+zksQF59 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2206 |
9+P7H//U+376afFuvh2/T6P85Xr/5c8C6OXyFY4BGuN+EE0+GeR201b+wkkLN5mmBY5TfMw8ngqL |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2207 |
CztXxCSXKMCYrRIElWkEJlEPYsSOeKBVZCAQTKBhApMwRFQzmCThE0YQu2CdEhgjbgmk9GluHpfR |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2208 |
/hhwJCZhGI5jt5FsAkOrObVyE6g2y1snyhMGFlDY1x+BoHpCMulTj5JYWNAYJmnKpvLxXgmQ8az1 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2209 |
4fUGxxcitMbbhDFcsiAItg04E+OSBIHTUYD1HI4FHH4kMREPknuYRMyhh3AARWMkfhCketqD1CWJ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2210 |
mTCo/nhUScoQcInB1hpFhIKoIXLo5jLpwFCgsnLCx1QlEMlz/iFEGqzH3vWYcpRcThgWnEKm0QcS |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2211 |
rA8ek2a2IYYeowUanOZOlrbWSJUC4c7y2EMI3uJPMnMF/SSXdk6E495VLhzkWHps0rOhKwqk+xBI |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2212 |
DhJirhdUCTamMfXz2Hy303hM4DFJ8QL21BcPBULR+gcdYxoeiDqOFSqpi5B5PUISfGg46gFZBPo4 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2213 |
jdh8lueaWuVSMTURfbAUnLINr/QYuuYoMQV6l1aWxuZVTjlaLC14UzqZ+ziTGDzJzhiYoPLrt3uI |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2214 |
tXkVR47kAo09lo5BD76CH51cTt1snVpMOttLhY93yxChCQPI4OBecS7++h4p4Bdn4H97bJongtPk |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2215 |
s9gQnXku1vzsjjmX4/o4YUDkXkjHwDg5FXozU0fW4y5kyeYW0uJWlh536BKr0kMGjtzTkng6Ep62 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2216 |
uTWnQtiIqKnEsx7e1hLtzlXs7Upw9TwEnp0t9yzCGgUJIZConx9OHJArLkRYW0dW42G9OeR5Nzwk |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2217 |
yk1mX7du5RGHT7dka7N3AznmSif7y6tuKe2N1Al/1TUPRqH6E2GLVc27h9IptMLkCKQYRqPQJgzV |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2218 |
2m6WLsSipS3v3b1/WmXEYY1meLEVIU/arOGVkyie7ZsH05ZKpjFW4cpY0YkjySpSExNG2TS8nnJx |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2219 |
nrQmWh2WY3cP1eISP9wbaVK35ZXc60yC3VN/j9n7UFoK6zvjSTE2+Pvz6Mx322rnftfP8Y0XKIdv |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2220 |
Qd7AfK0nexBTMqRiErvCMa3Hegpfjdh58glW2oNMsKeAX8x6YJLZs9K8/ozjJkWL+JmECMvhQ54x |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2221 |
9rsTHwcoGrDi6Y4I+H7yY4/rJVPAbYymUH7C2D3uiUS3KQ1nrCAUkE1dJMneDQIJMQQx5SONxoEO |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2222 |
OEn1/Ig1eBBUeEDRuOT2WGGGE4bNypBLFh2PeIg3bEbg44PHiqNDbGIQm50LW6MJU62JHCGBrmc9 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2223 |
2F7WBJrrj1ssnTAK4sxwRgh5LLblhwNAclv3Gd+jC/etCfyfR8TMhcWQz8TBIbG8IIyAQ81w2n/C |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2224 |
mHWAwRzxd3WoBY7BZnsqGOWrOCKwGkMMNfO0Kci/joZgEocLjNnzgcmdehPHJY0FudXgsr+v44TB |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2225 |
I3jnMGnsK5veAhgi9iXGifkHMOC09Rh9cAw9sQ0asl6wKMk8mpzFYaaDSgG4F0wisQDDBRpjCINg |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2226 |
FIxhlhQ31xdSkkk6odXZFpTYOQpOOgw9ugM2cDQ+2MYa7JsEirGBrOuxsQy5nPMRdYjsTJ/j1iNw |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2227 |
FeSt1jY2+dd5yx1/pzZMOQXUIDcXeAzR7QlDRM8AMkUldXOmGmvYXPABjxqkYKO7VAY6JRU7kpXr |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2228 |
+Epu2BU3qFFXClFi27784LrDZsJwbNlDw0JzhZ6M0SMXE4iBHehCpHVkrQhpTFn2dsvsZYkiPEEB |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2229 |
GSEAwdiur9LS1U6P2U9JhGp4hnFpJo4FfkdJHcwV6Q5dV1Q9uNeeu7rV8PAjwdFg9RLtroifOr0k |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2230 |
uOiRTo/obNPhQIf42Fr4mtThWoSjitEdAmFW66UCe8WFjPk1YVNpL9srFbond7jrLg8tqAasIMpy |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2231 |
zkH0SY/6zVAwJrEc14zt14YRXdY+fcJ4qOd2XKB0/Kghw1ovd11t2o+zjt+txndo1ZDZ2T+uMVHT |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2232 |
VSXhedBAHoJIID9xm6wPQI3cXY+HR7vxtrJuCKh6kbXaW5KkVeJsdsjqsYsOwYSh0w5sMbu7LF8J |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2233 |
5T7U6LJdiTx+ca7RKlulGgS5Z1JSU2Llt32cHFipkaurtBrvNX5UtvNZjkufZ/r1/XyLl6yOpytL |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2234 |
Km8Fn+y4wkhlqZP5db0rooqy7xdL4wxzFVTX+6HaxuQJK5E5B1neSSovZ9ALB8091dDbbjVxhWNY |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2235 |
Ve5hn1VnI9OF0wpvaRm7SZuC1IRczwC7GnkhPt3muHV1YxUJfo+uh1sYnJy+vI0ZwuPV2uqWJYUH |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2236 |
bmBsi1zmFSxHrqwA+WIzLrHkwW4r+bad7xbOzJCnKIa3S3YvrzEBK1Dc0emzJW+SqysQfdEDorQG |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2237 |
9ZJlbQzEHQV8naPaF440YXzJk/7vHGK2xwuP+Gc5xITxyiP+WQ4x18oXHjFzCBy9kir1EFTAm0Zq |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2238 |
LYwS8MpiGhtfxiBRDXpxDWxk9g9Q2fzPPAhS6VFDAc/aiNGatUkPtZIStZFQ1qD0IlJa/5ZPAi5J |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2239 |
ySp1ETDomZMnvgiysZSBfMikrSDte/K5lqV6iwC5q7YN9I1dBZXUytDJNqU74MJsUyNNLAPopWK3 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2240 |
tzmLkCiDyl7WQnj9sm7Kd5kzgpoccdNeMw/6zPVB3pUwMgi4C7hj4AMFAf4G27oXH8NNT9zll/sK |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2241 |
S6wVlQwazjxWKWy20ZzXb9ne8ngGalPBWSUSj9xkc1drsXkZ8oOyvYT3e0rnYsGwx85xZB9wKeKg |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2242 |
cJKZnamYwiaMymZvzk6wtDUkxmdUg0mPad0YHtvzpjEfp2iMxvORhnx0kCVLf5Qa43WJsVoyfEyI |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2243 |
pzmf8ruM6xBr7dnBgzyxpqXuUPYaKahOaz1LrxNkS/Q3Ae5AC+xl6NbxAqXXlzghZBZHmOrM6Y6Y |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2244 |
ctAkltwlF7SKEsShjVh7QHuxMU0a08/eiu3x3M+07OijMcKFFltByXrpk8w+JNnZpnp3CfgjV1Ax |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2245 |
gUYCnWwYow42I5wHCcTzLXK0hMZN2DrPM/zCSqe9jRSlJnr70BPE4+zrwbk/xVIDHy2FAQyHoomT |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2246 |
Tt5jiM68nBQut35Y0qLclLiQrutxt/c0OlSqXAC8VrxW97lGoRWzhOnifE2zbF05W4xuyhg7JTUL |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2247 |
aqJ7SWDywhjlal0b+NLTpERBgnPW0+Nw99X2Ws72gOL27iER9jgzj7Uu09JaZ3n+hmCjjvZpjNst |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2248 |
vOWWTbuLrg+/1ltX8WpPauEDEvcunIgTxuMEHweWKCx2KQ9DU/UKdO/3za4Szm2iHYL+ss9AAttm |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2249 |
gZHq2pkUXFbV+FiJCKrpBms18zH75vax5jSo7FNunrVWY3Chvd8KKnHdaTt/6ealwaA1x17yTlft |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2250 |
8VBle3nAE+7R0MScC3MJofNCCkA9PGKBgGMYEwfB2QO5j8zUqa8F/EkWKCzGQJ5EZ05HTly1B01E |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2251 |
z813G5BY++RZ2sxbQS8ZveGPJNabp5kXAeoign6Tlt5+L8i5ZquY9+S+KEUHkmYMRFBxRrHnbl2X |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2252 |
rVemKnG+oB1yd9+zT+4c43jQ0wWmQRR6mTCkY1q3VG05Y120ZzKOMBe6Vy7I5Vz4ygPB3yY4G0FP |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2253 |
8RxiMx985YJPXsgRU58EuHj75gygTzejP+W/zKGe78UQN3yOJ1aMQV9hFH+GAfLRsza84WlPLAI/ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2254 |
9G/5JdcHftEfH+Y3/fHUG7/o8bv98dzzy3e8S+XCvgqB+VUf7sH0yDHpONdbRE8tAg9NWOzcTJ7q |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2255 |
TuAxe/AJ07c1Rs9okJvl1/0G60qvbdDzz5zO0FuPFQIHNp9y9Bd1CufYVx7dB26mAxwa8GMNrN/U |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2256 |
oGbNZ3EQ7inLzHy5tRg9AXJrN8cB59cCUBeCiVO7zKM0jU0MamhnRThkg/NMmBOGb6StNeD9tDfA |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2257 |
7czsAWopDdnGoXUHtA+s/k0vNPkBcxEI13jVd/axp85va3LpwGggXXWw12Gwr/JGAH0b8CPboiZd |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2258 |
QO1l0mk/UHukud4C+w5uRoNzpCmoW6GbgbMyaQNkga2pQINB18lOXOCJzSWPFOhZcwzdgrsQnne7 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2259 |
nvjBi+7cP2BbtBeDOW5uOLGf3z94FasKIguOqJl+8ss/6Kumns4cuWbqq5592TN/RNIbn5Qo6qbi |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2260 |
O4F0P9txxPAwagqPlftztO8cWBzdN/jz3b7GD6JHYP/Zp4ToAMaA74M+EGSft3hEGMuf8EwjnTk/ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2261 |
nz/P7SLipB/ogQ6xNX0fDqNncMCfHqGLCMM0ZzFa+6lPJYQ5p81vW4HkCvidYf6kb+P/oB965g8K |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2262 |
C6uR0rdjX1DNKc5pOSTquI8uQ6KXxYaKBn+30/09tK4kMpJPgUIQkbENEPbuezNPPje2Um83SgyX |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2263 |
GTCJb6MnGVIpgncdQg1qz2bvPfxYD9fewCXDomx9S+HQJuX6W3VAL+v5WZMudRQZk9ZdOk6GIUtC |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2264 |
PqEb/uwSIrtR7/edzqgEdtpEwq7p2J5OQV+RLrmtTvFwFpf03M/VrRyTZ73qVod7v7Jh2Dwe5J25 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2265 |
JqFOU2qEu1sP+CRotklediycKfLjeIZzjJQsvKmiGSNQhxuJpKa+hoWUizaE1PuIRGzJqropwgVB |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2266 |
oo1hr870MZLgnXF5ZIpr6mF0L8aSy2gVnTAuoB4WEd4d5NPVC9TMotYXERKlTcwQ2KiB/C48AEfH |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2267 |
Qbyq4CN8xTFnTvf/ebOc3isnjD95s0QF0nx9s+y+zMmz782xL0SgEmRpA3x1w1Ff9/74xcxKEPdS |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2268 |
IEFTz6GgU0+BK/UZ5Gwbl4gZwycxEw+Kqa5QmMkh4OzgzEVPnDAiAOGBFaBW4wkDmj1G4RyElKgj |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2269 |
NlLCq8zsp085MNh/+R4t1Q8yxoSv8PUpTt7izZwf2BTHZZ3pIZpUIpuLkL1nNL6sYcHqcKm237wp |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2270 |
T2+RCjgXweXd2Zp7ZM8W6dG5bZsqo0nrJBTx8EC0+CQQdzEGnabTnkzofu1pYkWl4E7XSniECdxy |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2271 |
vLYavPMcL9LW5SToJFNnos+uqweOHriUZ1ntIYZUonc7ltEQ6oTRtwOHNwez2sVREskHN+bqG3ua |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2272 |
eaEbJ8XpyO8CeD9QJc8nbLP2C2R3A437ISUNyt5Yd0TbDNcl11/DSsOzdbi/VhCC0KE6v1vqVNkq |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2273 |
45ZnG6fiV2NwzInxCNth3BwL0+8814jE6+1W1EeWtpWbSZJOJNYXmWRXa7vLnAljE692eHjZ4y5u |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2274 |
y1u63De0IzKca7As48Z3XshVF+3XiLNz0JIMh/JOpbiNLlMi672uO0wYzOCZjRxcxj3D+gVenGIE |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2275 |
MvFUGGXuRps2RzMcgWIRolHXpGUP6sMsQt1hspUBnVKUn/WQj2u6j3SXd9Xz0QtEzoM7qTu5y7gR |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2276 |
q9gNNsrlEMLdikBt9bFvBnfbUIh6voTw7eDsyTmPKUvF0bHqWLbHe3VRHyRZnNeSGKsB73q66Vsk |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2277 |
taxWYmwz1tYVFG/vOQhlM0gUkyvIab3nv2caJ1udU1F3pDMty7stubTE4OJqm0i0ECfrJIkLtraC |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2278 |
HwRWKzlqpfhEIqYH09eT9WrOhQyt8YEoyBlnXtAT37WHIQ03TIuEHbnRxZDdLun0iok9PUC79prU |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2279 |
m5beZzfQUelEXnhzb/pIROKx3F7qCttYIFGh5dXNzFzID7u8vKykA8Uejf7XXz//S4nKvW//ofS/ |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2280 |
QastYw== |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2281 |
""") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2282 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2283 |
##file distutils-init.py |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2284 |
DISTUTILS_INIT = convert("""
|
| 6 | 2285 |
eJytV1uL4zYUfvevOE0ottuMW9q3gVDa3aUMXXbLMlDKMBiNrSTqOJKRlMxkf33PkXyRbGe7Dw2E |
2286 |
UXTu37lpxLFV2oIyifAncxmOL0xLIfcG+gv80x9VW6maw7o/CANSWWBwFtqeWMPlGY6qPjV8A0bB |
|
2287 |
C4eKSTgZ5LRgFeyErMEeOBhbN+Ipgeizhjtnhkn7DdyjuNLPoCS0l/ayQTG0djwZC08cLXozeMss |
|
2288 |
aG5EzQ0IScpnWtHSTXuxByV/QCmxE7y+eS0uxWeoheaVVfqSJHiU7Mhhi6gULbOHorshkrEnKxpT |
|
2289 |
0n3A8Y8SMpuwZx6aoix3ouFlmW8gHRSkeSJ2g7hU+kiHLDaQw3bmRDaTGfTnty7gPm0FHbIBg9U9 |
|
2290 |
oh1kZzAFLaue2R6htPCtAda2nGlDSUJ4PZBgCJBGVcwKTAMz/vJiLD+Oin5Z5QlvDPdulC6EsiyE |
|
2291 |
NFzb7McNTKJzbJqzphx92VKRFY1idenzmq3K0emRcbWBD0ryqc4NZGmKOOOX9Pz5x+/l27tP797c |
|
2292 |
f/z0d+4NruGNai8uAM0bfsYaw8itFk8ny41jsfpyO+BWlpqfhcG4yxLdi/0tQqoT4a8Vby382mt8 |
|
2293 |
p7XSo7aWGdPBc+b6utaBmCQ7rQKQoWtAuthQCiold2KfJIPTT8xwg9blPumc+YDZC/wYGdAyHpJk |
|
2294 |
vUbHbHWAp5No6pK/WhhLEWrFjUwtPEv1Agf8YmnsuXUQYkeZoHm8ogP16gt2uHoxcEMdf2C6pmbw |
|
2295 |
hUMsWGhanboh4IzzmsIpWs134jVPqD/c74bZHdY69UKKSn/+KfVhxLgUlToemayLMYQOqfEC61bh |
|
2296 |
cbhwaqoGUzIyZRFHPmau5juaWqwRn3mpWmoEA5nhzS5gog/5jbcFQqOZvmBasZtwYlG93k5GEiyw |
|
2297 |
buHhMWLjDarEGpMGB2LFs5nIJkhp/nUmZneFaRth++lieJtHepIvKgx6PJqIlD9X2j6pG1i9x3pZ |
|
2298 |
5bHuCPFiirGHeO7McvoXkz786GaKVzC9DSpnOxJdc4xm6NSVq7lNEnKdVlnpu9BNYoKX2Iq3wvgh |
|
2299 |
gGEUM66kK6j4NiyoneuPLSwaCWDxczgaolEWpiMyDVDb7dNuLAbriL8ig8mmeju31oNvQdpnvEPC |
|
2300 |
1vAXbWacGRVrGt/uXN/gU0CDDwgooKRrHfTBb1/s9lYZ8ZqOBU0yLvpuP6+K9hLFsvIjeNhBi0KL |
|
2301 |
MlOuWRn3FRwx5oHXjl0YImUx0+gLzjGchrgzca026ETmYJzPD+IpuKzNi8AFn048Thd63OdD86M6 |
|
2302 |
84zE8yQm0VqXdbbgvub2pKVnS76icBGdeTHHXTKspUmr4NYo/furFLKiMdQzFjHJNcdAnMhltBJK |
|
2303 |
0/IKX3DVFqvPJ2dLE7bDBkH0l/PJ29074+F0CsGYOxsb7U3myTUncYfXqnLLfa6sJybX4g+hmcjO |
|
2304 |
kMRBfA1JellfRRKJcyRpxdS4rIl6FdmQCWjo/o9Qz7yKffoP4JHjOvABcRn4CZIT2RH4jnxmfpVG |
|
2305 |
qgLaAvQBNfuO6X0/Ux02nb4FKx3vgP+XnkX0QW9pLy/NsXgdN24dD3LxO2Nwil7Zlc1dqtP3d7/h |
|
2306 |
kzp1/+7hGBuY4pk0XD/0Ao/oTe/XGrfyM773aB7iUhgkpy+dwAMalxMP0DrBcsVw/6p25+/hobP9 |
|
2307 |
GBknrWExDhLJ1bwt1NcCNblaFbMKCyvmX0PeRaQ= |
|
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2308 |
""") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2309 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2310 |
##file distutils.cfg |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2311 |
DISTUTILS_CFG = convert("""
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2312 |
eJxNj00KwkAMhfc9xYNuxe4Ft57AjYiUtDO1wXSmNJnK3N5pdSEEAu8nH6lxHVlRhtDHMPATA4uH |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2313 |
xJ4EFmGbvfJiicSHFRzUSISMY6hq3GLCRLnIvSTnEefN0FIjw5tF0Hkk9Q5dRunBsVoyFi24aaLg |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2314 |
9FDOlL0FPGluf4QjcInLlxd6f6rqkgPu/5nHLg0cXCscXoozRrP51DRT3j9QNl99AP53T2Q= |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2315 |
""") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2316 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2317 |
##file activate_this.py |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2318 |
ACTIVATE_THIS = convert("""
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2319 |
eJyNU01v2zAMvetXEB4K21jmDOstQA4dMGCHbeihlyEIDMWmG62yJEiKE//7kXKdpN2KzYBt8euR |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2320 |
fKSyLPs8wiEo8wh4wqZTGou4V6Hm0wJa1cSiTkJdr8+GsoTRHuCotBayiWqQEYGtMCgfD1KjGYBe |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2321 |
5a3p0cRKiAe2NtLADikftnDco0ko/SFEVgEZ8aRC5GLux7i3BpSJ6J1H+i7A2CjiHq9z7JRZuuQq |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2322 |
siwTIvpxJYCeuWaBpwZdhB+yxy/eWz+ZvVSU8C4E9FFZkyxFsvCT/ZzL8gcz9aXVE14Yyp2M+2W0 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2323 |
y7n5mp0qN+avKXvbsyyzUqjeWR8hjGE+2iCE1W1tQ82hsCZN9UzlJr+/e/iab8WfqsmPI6pWeUPd |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2324 |
FrMsd4H/55poeO9n54COhUs+sZNEzNtg/wanpjpuqHJaxs76HtZryI/K3H7KJ/KDIhqcbJ7kI4ar |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2325 |
XL+sMgXnX0D+Te2Iy5xdP8yueSlQB/x/ED2BTAtyE3K4SYUN6AMNfbO63f4lBW3bUJPbTL+mjSxS |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2326 |
PyRfJkZRgj+VbFv+EzHFi5pKwUEepa4JslMnwkowSRCXI+m5XvEOvtuBrxHdhLalG0JofYBok6qj |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2327 |
YdN2dEngUlbC4PG60M1WEN0piu7Nq7on0mgyyUw3iV1etLo6r/81biWdQ9MWHFaePWZYaq+nmp+t |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2328 |
s3az+sj7eA0jfgPfeoN1 |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2329 |
""") |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2330 |
|
| 6 | 2331 |
MH_MAGIC = 0xfeedface |
2332 |
MH_CIGAM = 0xcefaedfe |
|
2333 |
MH_MAGIC_64 = 0xfeedfacf |
|
2334 |
MH_CIGAM_64 = 0xcffaedfe |
|
2335 |
FAT_MAGIC = 0xcafebabe |
|
2336 |
BIG_ENDIAN = '>' |
|
2337 |
LITTLE_ENDIAN = '<' |
|
2338 |
LC_LOAD_DYLIB = 0xc |
|
2339 |
maxint = majver == 3 and getattr(sys, 'maxsize') or getattr(sys, 'maxint') |
|
2340 |
||
2341 |
||
2342 |
class fileview(object): |
|
2343 |
""" |
|
2344 |
A proxy for file-like objects that exposes a given view of a file. |
|
2345 |
Modified from macholib. |
|
2346 |
""" |
|
2347 |
||
2348 |
def __init__(self, fileobj, start=0, size=maxint): |
|
2349 |
if isinstance(fileobj, fileview): |
|
2350 |
self._fileobj = fileobj._fileobj |
|
2351 |
else: |
|
2352 |
self._fileobj = fileobj |
|
2353 |
self._start = start |
|
2354 |
self._end = start + size |
|
2355 |
self._pos = 0 |
|
2356 |
||
2357 |
def __repr__(self): |
|
2358 |
return '<fileview [%d, %d] %r>' % ( |
|
2359 |
self._start, self._end, self._fileobj) |
|
2360 |
||
2361 |
def tell(self): |
|
2362 |
return self._pos |
|
2363 |
||
2364 |
def _checkwindow(self, seekto, op): |
|
2365 |
if not (self._start <= seekto <= self._end): |
|
2366 |
raise IOError("%s to offset %d is outside window [%d, %d]" % (
|
|
2367 |
op, seekto, self._start, self._end)) |
|
2368 |
||
2369 |
def seek(self, offset, whence=0): |
|
2370 |
seekto = offset |
|
2371 |
if whence == os.SEEK_SET: |
|
2372 |
seekto += self._start |
|
2373 |
elif whence == os.SEEK_CUR: |
|
2374 |
seekto += self._start + self._pos |
|
2375 |
elif whence == os.SEEK_END: |
|
2376 |
seekto += self._end |
|
2377 |
else: |
|
2378 |
raise IOError("Invalid whence argument to seek: %r" % (whence,))
|
|
2379 |
self._checkwindow(seekto, 'seek') |
|
2380 |
self._fileobj.seek(seekto) |
|
2381 |
self._pos = seekto - self._start |
|
2382 |
||
2383 |
def write(self, bytes): |
|
2384 |
here = self._start + self._pos |
|
2385 |
self._checkwindow(here, 'write') |
|
2386 |
self._checkwindow(here + len(bytes), 'write') |
|
2387 |
self._fileobj.seek(here, os.SEEK_SET) |
|
2388 |
self._fileobj.write(bytes) |
|
2389 |
self._pos += len(bytes) |
|
2390 |
||
2391 |
def read(self, size=maxint): |
|
2392 |
assert size >= 0 |
|
2393 |
here = self._start + self._pos |
|
2394 |
self._checkwindow(here, 'read') |
|
2395 |
size = min(size, self._end - here) |
|
2396 |
self._fileobj.seek(here, os.SEEK_SET) |
|
2397 |
bytes = self._fileobj.read(size) |
|
2398 |
self._pos += len(bytes) |
|
2399 |
return bytes |
|
2400 |
||
2401 |
||
2402 |
def read_data(file, endian, num=1): |
|
2403 |
""" |
|
2404 |
Read a given number of 32-bits unsigned integers from the given file |
|
2405 |
with the given endianness. |
|
2406 |
""" |
|
2407 |
res = struct.unpack(endian + 'L' * num, file.read(num * 4)) |
|
2408 |
if len(res) == 1: |
|
2409 |
return res[0] |
|
2410 |
return res |
|
2411 |
||
2412 |
||
2413 |
def mach_o_change(path, what, value): |
|
2414 |
""" |
|
2415 |
Replace a given name (what) in any LC_LOAD_DYLIB command found in |
|
2416 |
the given binary with a new name (value), provided it's shorter. |
|
2417 |
""" |
|
2418 |
||
2419 |
def do_macho(file, bits, endian): |
|
2420 |
# Read Mach-O header (the magic number is assumed read by the caller) |
|
2421 |
cputype, cpusubtype, filetype, ncmds, sizeofcmds, flags = read_data(file, endian, 6) |
|
2422 |
# 64-bits header has one more field. |
|
2423 |
if bits == 64: |
|
2424 |
read_data(file, endian) |
|
2425 |
# The header is followed by ncmds commands |
|
2426 |
for n in range(ncmds): |
|
2427 |
where = file.tell() |
|
2428 |
# Read command header |
|
2429 |
cmd, cmdsize = read_data(file, endian, 2) |
|
2430 |
if cmd == LC_LOAD_DYLIB: |
|
2431 |
# The first data field in LC_LOAD_DYLIB commands is the |
|
2432 |
# offset of the name, starting from the beginning of the |
|
2433 |
# command. |
|
2434 |
name_offset = read_data(file, endian) |
|
2435 |
file.seek(where + name_offset, os.SEEK_SET) |
|
2436 |
# Read the NUL terminated string |
|
2437 |
load = file.read(cmdsize - name_offset).decode() |
|
2438 |
load = load[:load.index('\0')]
|
|
2439 |
# If the string is what is being replaced, overwrite it. |
|
2440 |
if load == what: |
|
2441 |
file.seek(where + name_offset, os.SEEK_SET) |
|
2442 |
file.write(value.encode() + '\0'.encode()) |
|
2443 |
# Seek to the next command |
|
2444 |
file.seek(where + cmdsize, os.SEEK_SET) |
|
2445 |
||
2446 |
def do_file(file, offset=0, size=maxint): |
|
2447 |
file = fileview(file, offset, size) |
|
2448 |
# Read magic number |
|
2449 |
magic = read_data(file, BIG_ENDIAN) |
|
2450 |
if magic == FAT_MAGIC: |
|
2451 |
# Fat binaries contain nfat_arch Mach-O binaries |
|
2452 |
nfat_arch = read_data(file, BIG_ENDIAN) |
|
2453 |
for n in range(nfat_arch): |
|
2454 |
# Read arch header |
|
2455 |
cputype, cpusubtype, offset, size, align = read_data(file, BIG_ENDIAN, 5) |
|
2456 |
do_file(file, offset, size) |
|
2457 |
elif magic == MH_MAGIC: |
|
2458 |
do_macho(file, 32, BIG_ENDIAN) |
|
2459 |
elif magic == MH_CIGAM: |
|
2460 |
do_macho(file, 32, LITTLE_ENDIAN) |
|
2461 |
elif magic == MH_MAGIC_64: |
|
2462 |
do_macho(file, 64, BIG_ENDIAN) |
|
2463 |
elif magic == MH_CIGAM_64: |
|
2464 |
do_macho(file, 64, LITTLE_ENDIAN) |
|
2465 |
||
2466 |
assert(len(what) >= len(value)) |
|
2467 |
do_file(open(path, 'r+b')) |
|
2468 |
||
2469 |
||
|
1
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2470 |
if __name__ == '__main__': |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2471 |
main() |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2472 |
|
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2473 |
## TODO: |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2474 |
## Copy python.exe.manifest |
|
08f6e99af174
prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2475 |
## Monkeypatch distutils.sysconfig |