virtual-bootstrap.py 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506
  1. #!/usr/bin/env python
  2. # Licensed to Cloudera, Inc. under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. Cloudera, Inc. licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. ## WARNING: This file is (partly) generated
  18. """Create a "virtual" Python installation
  19. """
  20. virtualenv_version = "1.4.5"
  21. import sys
  22. import os
  23. import optparse
  24. import re
  25. import shutil
  26. import logging
  27. import distutils.sysconfig
  28. try:
  29. import subprocess
  30. except ImportError, e:
  31. if sys.version_info <= (2, 3):
  32. print 'ERROR: %s' % e
  33. print 'ERROR: this script requires Python 2.4 or greater; or at least the subprocess module.'
  34. print 'If you copy subprocess.py from a newer version of Python this script will probably work'
  35. sys.exit(101)
  36. else:
  37. raise
  38. try:
  39. set
  40. except NameError:
  41. from sets import Set as set
  42. join = os.path.join
  43. py_version = 'python%s.%s' % (sys.version_info[0], sys.version_info[1])
  44. is_jython = sys.platform.startswith('java')
  45. expected_exe = is_jython and 'jython' or 'python'
  46. REQUIRED_MODULES = ['os', 'posix', 'posixpath', 'ntpath', 'genericpath',
  47. 'fnmatch', 'locale', 'encodings', 'codecs',
  48. 'stat', 'UserDict', 'readline', 'copy_reg', 'types',
  49. 're', 'sre', 'sre_parse', 'sre_constants', 'sre_compile',
  50. 'lib-dynload', 'config', 'zlib']
  51. if sys.version_info[:2] == (2, 6):
  52. REQUIRED_MODULES.extend(['warnings', 'linecache', '_abcoll', 'abc'])
  53. if sys.version_info[:2] <= (2, 3):
  54. REQUIRED_MODULES.extend(['sets', '__future__'])
  55. class Logger(object):
  56. """
  57. Logging object for use in command-line script. Allows ranges of
  58. levels, to avoid some redundancy of displayed information.
  59. """
  60. DEBUG = logging.DEBUG
  61. INFO = logging.INFO
  62. NOTIFY = (logging.INFO+logging.WARN)/2
  63. WARN = WARNING = logging.WARN
  64. ERROR = logging.ERROR
  65. FATAL = logging.FATAL
  66. LEVELS = [DEBUG, INFO, NOTIFY, WARN, ERROR, FATAL]
  67. def __init__(self, consumers):
  68. self.consumers = consumers
  69. self.indent = 0
  70. self.in_progress = None
  71. self.in_progress_hanging = False
  72. def debug(self, msg, *args, **kw):
  73. self.log(self.DEBUG, msg, *args, **kw)
  74. def info(self, msg, *args, **kw):
  75. self.log(self.INFO, msg, *args, **kw)
  76. def notify(self, msg, *args, **kw):
  77. self.log(self.NOTIFY, msg, *args, **kw)
  78. def warn(self, msg, *args, **kw):
  79. self.log(self.WARN, msg, *args, **kw)
  80. def error(self, msg, *args, **kw):
  81. self.log(self.WARN, msg, *args, **kw)
  82. def fatal(self, msg, *args, **kw):
  83. self.log(self.FATAL, msg, *args, **kw)
  84. def log(self, level, msg, *args, **kw):
  85. if args:
  86. if kw:
  87. raise TypeError(
  88. "You may give positional or keyword arguments, not both")
  89. args = args or kw
  90. rendered = None
  91. for consumer_level, consumer in self.consumers:
  92. if self.level_matches(level, consumer_level):
  93. if (self.in_progress_hanging
  94. and consumer in (sys.stdout, sys.stderr)):
  95. self.in_progress_hanging = False
  96. sys.stdout.write('\n')
  97. sys.stdout.flush()
  98. if rendered is None:
  99. if args:
  100. rendered = msg % args
  101. else:
  102. rendered = msg
  103. rendered = ' '*self.indent + rendered
  104. if hasattr(consumer, 'write'):
  105. consumer.write(rendered+'\n')
  106. else:
  107. consumer(rendered)
  108. def start_progress(self, msg):
  109. assert not self.in_progress, (
  110. "Tried to start_progress(%r) while in_progress %r"
  111. % (msg, self.in_progress))
  112. if self.level_matches(self.NOTIFY, self._stdout_level()):
  113. sys.stdout.write(msg)
  114. sys.stdout.flush()
  115. self.in_progress_hanging = True
  116. else:
  117. self.in_progress_hanging = False
  118. self.in_progress = msg
  119. def end_progress(self, msg='done.'):
  120. assert self.in_progress, (
  121. "Tried to end_progress without start_progress")
  122. if self.stdout_level_matches(self.NOTIFY):
  123. if not self.in_progress_hanging:
  124. # Some message has been printed out since start_progress
  125. sys.stdout.write('...' + self.in_progress + msg + '\n')
  126. sys.stdout.flush()
  127. else:
  128. sys.stdout.write(msg + '\n')
  129. sys.stdout.flush()
  130. self.in_progress = None
  131. self.in_progress_hanging = False
  132. def show_progress(self):
  133. """If we are in a progress scope, and no log messages have been
  134. shown, write out another '.'"""
  135. if self.in_progress_hanging:
  136. sys.stdout.write('.')
  137. sys.stdout.flush()
  138. def stdout_level_matches(self, level):
  139. """Returns true if a message at this level will go to stdout"""
  140. return self.level_matches(level, self._stdout_level())
  141. def _stdout_level(self):
  142. """Returns the level that stdout runs at"""
  143. for level, consumer in self.consumers:
  144. if consumer is sys.stdout:
  145. return level
  146. return self.FATAL
  147. def level_matches(self, level, consumer_level):
  148. """
  149. >>> l = Logger()
  150. >>> l.level_matches(3, 4)
  151. False
  152. >>> l.level_matches(3, 2)
  153. True
  154. >>> l.level_matches(slice(None, 3), 3)
  155. False
  156. >>> l.level_matches(slice(None, 3), 2)
  157. True
  158. >>> l.level_matches(slice(1, 3), 1)
  159. True
  160. >>> l.level_matches(slice(2, 3), 1)
  161. False
  162. """
  163. if isinstance(level, slice):
  164. start, stop = level.start, level.stop
  165. if start is not None and start > consumer_level:
  166. return False
  167. if stop is not None or stop <= consumer_level:
  168. return False
  169. return True
  170. else:
  171. return level >= consumer_level
  172. #@classmethod
  173. def level_for_integer(cls, level):
  174. levels = cls.LEVELS
  175. if level < 0:
  176. return levels[0]
  177. if level >= len(levels):
  178. return levels[-1]
  179. return levels[level]
  180. level_for_integer = classmethod(level_for_integer)
  181. def mkdir(path):
  182. if not os.path.exists(path):
  183. logger.info('Creating %s', path)
  184. os.makedirs(path)
  185. else:
  186. logger.info('Directory %s already exists', path)
  187. def copyfile(src, dest, symlink=True):
  188. if not os.path.exists(src):
  189. # Some bad symlink in the src
  190. logger.warn('Cannot find file %s (bad symlink)', src)
  191. return
  192. if os.path.exists(dest):
  193. logger.debug('File %s already exists', dest)
  194. return
  195. if not os.path.exists(os.path.dirname(dest)):
  196. logger.info('Creating parent directories for %s' % os.path.dirname(dest))
  197. os.makedirs(os.path.dirname(dest))
  198. if symlink and hasattr(os, 'symlink'):
  199. logger.info('Symlinking %s', dest)
  200. os.symlink(os.path.abspath(src), dest)
  201. else:
  202. logger.info('Copying to %s', dest)
  203. if os.path.isdir(src):
  204. shutil.copytree(src, dest, True)
  205. else:
  206. shutil.copy2(src, dest)
  207. def writefile(dest, content, overwrite=True):
  208. if not os.path.exists(dest):
  209. logger.info('Writing %s', dest)
  210. f = open(dest, 'wb')
  211. f.write(content)
  212. f.close()
  213. return
  214. else:
  215. f = open(dest, 'rb')
  216. c = f.read()
  217. f.close()
  218. if c != content:
  219. if not overwrite:
  220. logger.notify('File %s exists with different content; not overwriting', dest)
  221. return
  222. logger.notify('Overwriting %s with new content', dest)
  223. f = open(dest, 'wb')
  224. f.write(content)
  225. f.close()
  226. else:
  227. logger.info('Content %s already in place', dest)
  228. def rmtree(dir):
  229. if os.path.exists(dir):
  230. logger.notify('Deleting tree %s', dir)
  231. shutil.rmtree(dir)
  232. else:
  233. logger.info('Do not need to delete %s; already gone', dir)
  234. def make_exe(fn):
  235. if hasattr(os, 'chmod'):
  236. oldmode = os.stat(fn).st_mode & 07777
  237. newmode = (oldmode | 0555) & 07777
  238. os.chmod(fn, newmode)
  239. logger.info('Changed mode of %s to %s', fn, oct(newmode))
  240. def _find_file(filename, dirs):
  241. for dir in dirs:
  242. if os.path.exists(join(dir, filename)):
  243. return join(dir, filename)
  244. return filename
  245. def _install_req(py_executable, unzip=False, distribute=False):
  246. if not distribute:
  247. setup_fn = 'setuptools-0.6c11-py%s.egg' % sys.version[:3]
  248. project_name = 'setuptools'
  249. bootstrap_script = EZ_SETUP_PY
  250. source = None
  251. else:
  252. setup_fn = None
  253. source = 'distribute-0.6.8.tar.gz'
  254. project_name = 'distribute'
  255. bootstrap_script = DISTRIBUTE_SETUP_PY
  256. try:
  257. # check if the global Python has distribute installed or plain
  258. # setuptools
  259. import pkg_resources
  260. if not hasattr(pkg_resources, '_distribute'):
  261. location = os.path.dirname(pkg_resources.__file__)
  262. logger.notify("A globally installed setuptools was found (in %s)" % location)
  263. logger.notify("Use the --no-site-packages option to use distribute in "
  264. "the virtualenv.")
  265. except ImportError:
  266. pass
  267. search_dirs = file_search_dirs()
  268. if setup_fn is not None:
  269. setup_fn = _find_file(setup_fn, search_dirs)
  270. if source is not None:
  271. source = _find_file(source, search_dirs)
  272. if is_jython and os._name == 'nt':
  273. # Jython's .bat sys.executable can't handle a command line
  274. # argument with newlines
  275. import tempfile
  276. fd, ez_setup = tempfile.mkstemp('.py')
  277. os.write(fd, bootstrap_script)
  278. os.close(fd)
  279. cmd = [py_executable, ez_setup]
  280. else:
  281. cmd = [py_executable, '-c', bootstrap_script]
  282. if unzip:
  283. cmd.append('--always-unzip')
  284. env = {}
  285. if logger.stdout_level_matches(logger.DEBUG):
  286. cmd.append('-v')
  287. old_chdir = os.getcwd()
  288. if setup_fn is not None and os.path.exists(setup_fn):
  289. logger.info('Using existing %s egg: %s' % (project_name, setup_fn))
  290. cmd.append(setup_fn)
  291. if os.environ.get('PYTHONPATH'):
  292. env['PYTHONPATH'] = setup_fn + os.path.pathsep + os.environ['PYTHONPATH']
  293. else:
  294. env['PYTHONPATH'] = setup_fn
  295. else:
  296. # the source is found, let's chdir
  297. if source is not None and os.path.exists(source):
  298. os.chdir(os.path.dirname(source))
  299. else:
  300. logger.info('No %s egg found; downloading' % project_name)
  301. cmd.extend(['--always-copy', '-U', project_name])
  302. logger.start_progress('Installing %s...' % project_name)
  303. logger.indent += 2
  304. cwd = None
  305. if project_name == 'distribute':
  306. env['DONT_PATCH_SETUPTOOLS'] = 'true'
  307. def _filter_ez_setup(line):
  308. return filter_ez_setup(line, project_name)
  309. if not os.access(os.getcwd(), os.W_OK):
  310. cwd = '/tmp'
  311. if source is not None and os.path.exists(source):
  312. # the current working dir is hostile, let's copy the
  313. # tarball to /tmp
  314. target = os.path.join(cwd, os.path.split(source)[-1])
  315. shutil.copy(source, target)
  316. try:
  317. call_subprocess(cmd, show_stdout=False,
  318. filter_stdout=_filter_ez_setup,
  319. extra_env=env,
  320. cwd=cwd)
  321. finally:
  322. logger.indent -= 2
  323. logger.end_progress()
  324. if os.getcwd() != old_chdir:
  325. os.chdir(old_chdir)
  326. if is_jython and os._name == 'nt':
  327. os.remove(ez_setup)
  328. def file_search_dirs():
  329. here = os.path.dirname(os.path.abspath(__file__))
  330. dirs = ['.', here,
  331. join(here, 'virtualenv_support')]
  332. if os.path.splitext(os.path.dirname(__file__))[0] != 'virtualenv':
  333. # Probably some boot script; just in case virtualenv is installed...
  334. try:
  335. import virtualenv
  336. except ImportError:
  337. pass
  338. else:
  339. dirs.append(os.path.join(os.path.dirname(virtualenv.__file__), 'virtualenv_support'))
  340. return [d for d in dirs if os.path.isdir(d)]
  341. def install_setuptools(py_executable, unzip=False):
  342. _install_req(py_executable, unzip)
  343. def install_distribute(py_executable, unzip=False):
  344. _install_req(py_executable, unzip, distribute=True)
  345. _pip_re = re.compile(r'^pip-.*(zip|tar.gz|tar.bz2|tgz|tbz)$', re.I)
  346. def install_pip(py_executable):
  347. filenames = []
  348. for dir in file_search_dirs():
  349. filenames.extend([join(dir, fn) for fn in os.listdir(dir)
  350. if _pip_re.search(fn)])
  351. filenames.sort(key=lambda x: os.path.basename(x).lower())
  352. if not filenames:
  353. filename = 'pip'
  354. else:
  355. filename = filenames[-1]
  356. easy_install_script = 'easy_install'
  357. if sys.platform == 'win32':
  358. easy_install_script = 'easy_install-script.py'
  359. cmd = [py_executable, join(os.path.dirname(py_executable), easy_install_script), filename]
  360. if filename == 'pip':
  361. logger.info('Installing pip from network...')
  362. else:
  363. logger.info('Installing %s' % os.path.basename(filename))
  364. logger.indent += 2
  365. def _filter_setup(line):
  366. return filter_ez_setup(line, 'pip')
  367. try:
  368. call_subprocess(cmd, show_stdout=False,
  369. filter_stdout=_filter_setup)
  370. finally:
  371. logger.indent -= 2
  372. def filter_ez_setup(line, project_name='setuptools'):
  373. if not line.strip():
  374. return Logger.DEBUG
  375. if project_name == 'distribute':
  376. for prefix in ('Extracting', 'Now working', 'Installing', 'Before',
  377. 'Scanning', 'Setuptools', 'Egg', 'Already',
  378. 'running', 'writing', 'reading', 'installing',
  379. 'creating', 'copying', 'byte-compiling', 'removing',
  380. 'Processing'):
  381. if line.startswith(prefix):
  382. return Logger.DEBUG
  383. return Logger.DEBUG
  384. for prefix in ['Reading ', 'Best match', 'Processing setuptools',
  385. 'Copying setuptools', 'Adding setuptools',
  386. 'Installing ', 'Installed ']:
  387. if line.startswith(prefix):
  388. return Logger.DEBUG
  389. return Logger.INFO
  390. def main():
  391. parser = optparse.OptionParser(
  392. version=virtualenv_version,
  393. usage="%prog [OPTIONS] DEST_DIR")
  394. parser.add_option(
  395. '-v', '--verbose',
  396. action='count',
  397. dest='verbose',
  398. default=0,
  399. help="Increase verbosity")
  400. parser.add_option(
  401. '-q', '--quiet',
  402. action='count',
  403. dest='quiet',
  404. default=0,
  405. help='Decrease verbosity')
  406. parser.add_option(
  407. '-p', '--python',
  408. dest='python',
  409. metavar='PYTHON_EXE',
  410. help='The Python interpreter to use, e.g., --python=python2.5 will use the python2.5 '
  411. 'interpreter to create the new environment. The default is the interpreter that '
  412. 'virtualenv was installed with (%s)' % sys.executable)
  413. parser.add_option(
  414. '--clear',
  415. dest='clear',
  416. action='store_true',
  417. help="Clear out the non-root install and start from scratch")
  418. parser.add_option(
  419. '--no-site-packages',
  420. dest='no_site_packages',
  421. action='store_true',
  422. help="Don't give access to the global site-packages dir to the "
  423. "virtual environment")
  424. parser.add_option(
  425. '--unzip-setuptools',
  426. dest='unzip_setuptools',
  427. action='store_true',
  428. help="Unzip Setuptools or Distribute when installing it")
  429. parser.add_option(
  430. '--relocatable',
  431. dest='relocatable',
  432. action='store_true',
  433. help='Make an EXISTING virtualenv environment relocatable. '
  434. 'This fixes up scripts and makes all .pth files relative')
  435. parser.add_option(
  436. '--distribute',
  437. dest='use_distribute',
  438. action='store_true',
  439. help='Use Distribute instead of Setuptools. Set environ variable'
  440. 'VIRTUALENV_USE_DISTRIBUTE to make it the default ')
  441. if 'extend_parser' in globals():
  442. extend_parser(parser)
  443. options, args = parser.parse_args()
  444. global logger
  445. if 'adjust_options' in globals():
  446. adjust_options(options, args)
  447. verbosity = options.verbose - options.quiet
  448. logger = Logger([(Logger.level_for_integer(2-verbosity), sys.stdout)])
  449. if options.python and not os.environ.get('VIRTUALENV_INTERPRETER_RUNNING'):
  450. env = os.environ.copy()
  451. interpreter = resolve_interpreter(options.python)
  452. if interpreter == sys.executable:
  453. logger.warn('Already using interpreter %s' % interpreter)
  454. else:
  455. logger.notify('Running virtualenv with interpreter %s' % interpreter)
  456. env['VIRTUALENV_INTERPRETER_RUNNING'] = 'true'
  457. file = __file__
  458. if file.endswith('.pyc'):
  459. file = file[:-1]
  460. os.execvpe(interpreter, [interpreter, file] + sys.argv[1:], env)
  461. if not args:
  462. print 'You must provide a DEST_DIR'
  463. parser.print_help()
  464. sys.exit(2)
  465. if len(args) > 1:
  466. print 'There must be only one argument: DEST_DIR (you gave %s)' % (
  467. ' '.join(args))
  468. parser.print_help()
  469. sys.exit(2)
  470. home_dir = args[0]
  471. if os.environ.get('WORKING_ENV'):
  472. logger.fatal('ERROR: you cannot run virtualenv while in a workingenv')
  473. logger.fatal('Please deactivate your workingenv, then re-run this script')
  474. sys.exit(3)
  475. if os.environ.get('PYTHONHOME'):
  476. if sys.platform == 'win32':
  477. name = '%PYTHONHOME%'
  478. else:
  479. name = '$PYTHONHOME'
  480. logger.warn('%s is set; this can cause problems creating environments' % name)
  481. if options.relocatable:
  482. make_environment_relocatable(home_dir)
  483. return
  484. create_environment(home_dir, site_packages=not options.no_site_packages, clear=options.clear,
  485. unzip_setuptools=options.unzip_setuptools,
  486. use_distribute=options.use_distribute)
  487. if 'after_install' in globals():
  488. after_install(options, home_dir)
  489. def call_subprocess(cmd, show_stdout=True,
  490. filter_stdout=None, cwd=None,
  491. raise_on_returncode=True, extra_env=None):
  492. cmd_parts = []
  493. for part in cmd:
  494. if len(part) > 40:
  495. part = part[:30]+"..."+part[-5:]
  496. if ' ' in part or '\n' in part or '"' in part or "'" in part:
  497. part = '"%s"' % part.replace('"', '\\"')
  498. cmd_parts.append(part)
  499. cmd_desc = ' '.join(cmd_parts)
  500. if show_stdout:
  501. stdout = None
  502. else:
  503. stdout = subprocess.PIPE
  504. logger.debug("Running command %s" % cmd_desc)
  505. if extra_env:
  506. env = os.environ.copy()
  507. env.update(extra_env)
  508. else:
  509. env = None
  510. try:
  511. proc = subprocess.Popen(
  512. cmd, stderr=subprocess.STDOUT, stdin=None, stdout=stdout,
  513. cwd=cwd, env=env)
  514. except Exception, e:
  515. logger.fatal(
  516. "Error %s while executing command %s" % (e, cmd_desc))
  517. raise
  518. all_output = []
  519. if stdout is not None:
  520. stdout = proc.stdout
  521. while 1:
  522. line = stdout.readline()
  523. if not line:
  524. break
  525. line = line.rstrip()
  526. all_output.append(line)
  527. if filter_stdout:
  528. level = filter_stdout(line)
  529. if isinstance(level, tuple):
  530. level, line = level
  531. logger.log(level, line)
  532. if not logger.stdout_level_matches(level):
  533. logger.show_progress()
  534. else:
  535. logger.info(line)
  536. else:
  537. proc.communicate()
  538. proc.wait()
  539. if proc.returncode:
  540. if raise_on_returncode:
  541. if all_output:
  542. logger.notify('Complete output from command %s:' % cmd_desc)
  543. logger.notify('\n'.join(all_output) + '\n----------------------------------------')
  544. raise OSError(
  545. "Command %s failed with error code %s"
  546. % (cmd_desc, proc.returncode))
  547. else:
  548. logger.warn(
  549. "Command %s had error code %s"
  550. % (cmd_desc, proc.returncode))
  551. def create_environment(home_dir, site_packages=True, clear=False,
  552. unzip_setuptools=False, use_distribute=False):
  553. """
  554. Creates a new environment in ``home_dir``.
  555. If ``site_packages`` is true (the default) then the global
  556. ``site-packages/`` directory will be on the path.
  557. If ``clear`` is true (default False) then the environment will
  558. first be cleared.
  559. """
  560. home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir)
  561. py_executable = os.path.abspath(install_python(
  562. home_dir, lib_dir, inc_dir, bin_dir,
  563. site_packages=site_packages, clear=clear))
  564. install_distutils(lib_dir, home_dir)
  565. if use_distribute or os.environ.get('VIRTUALENV_USE_DISTRIBUTE'):
  566. install_distribute(py_executable, unzip=unzip_setuptools)
  567. else:
  568. install_setuptools(py_executable, unzip=unzip_setuptools)
  569. install_pip(py_executable)
  570. install_activate(home_dir, bin_dir)
  571. def path_locations(home_dir):
  572. """Return the path locations for the environment (where libraries are,
  573. where scripts go, etc)"""
  574. # XXX: We'd use distutils.sysconfig.get_python_inc/lib but its
  575. # prefix arg is broken: http://bugs.python.org/issue3386
  576. if sys.platform == 'win32':
  577. # Windows has lots of problems with executables with spaces in
  578. # the name; this function will remove them (using the ~1
  579. # format):
  580. mkdir(home_dir)
  581. if ' ' in home_dir:
  582. try:
  583. import win32api
  584. except ImportError:
  585. print 'Error: the path "%s" has a space in it' % home_dir
  586. print 'To handle these kinds of paths, the win32api module must be installed:'
  587. print ' http://sourceforge.net/projects/pywin32/'
  588. sys.exit(3)
  589. home_dir = win32api.GetShortPathName(home_dir)
  590. lib_dir = join(home_dir, 'Lib')
  591. inc_dir = join(home_dir, 'Include')
  592. bin_dir = join(home_dir, 'Scripts')
  593. elif is_jython:
  594. lib_dir = join(home_dir, 'Lib')
  595. inc_dir = join(home_dir, 'Include')
  596. bin_dir = join(home_dir, 'bin')
  597. else:
  598. lib_dir = join(home_dir, 'lib', py_version)
  599. inc_dir = join(home_dir, 'include', py_version)
  600. bin_dir = join(home_dir, 'bin')
  601. return home_dir, lib_dir, inc_dir, bin_dir
  602. def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
  603. """Install just the base environment, no distutils patches etc"""
  604. if sys.executable.startswith(bin_dir):
  605. print 'Please use the *system* python to run this script'
  606. return
  607. if clear:
  608. rmtree(lib_dir)
  609. ## FIXME: why not delete it?
  610. ## Maybe it should delete everything with #!/path/to/venv/python in it
  611. logger.notify('Not deleting %s', bin_dir)
  612. if hasattr(sys, 'real_prefix'):
  613. logger.notify('Using real prefix %r' % sys.real_prefix)
  614. prefix = sys.real_prefix
  615. else:
  616. prefix = sys.prefix
  617. mkdir(lib_dir)
  618. fix_lib64(lib_dir)
  619. stdlib_dirs = [os.path.dirname(os.__file__)]
  620. if sys.platform == 'win32':
  621. stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs'))
  622. elif sys.platform == 'darwin':
  623. stdlib_dirs.append(join(stdlib_dirs[0], 'site-packages'))
  624. for stdlib_dir in stdlib_dirs:
  625. if not os.path.isdir(stdlib_dir):
  626. continue
  627. if hasattr(os, 'symlink'):
  628. logger.info('Symlinking Python bootstrap modules')
  629. else:
  630. logger.info('Copying Python bootstrap modules')
  631. logger.indent += 2
  632. try:
  633. for fn in os.listdir(stdlib_dir):
  634. if fn != 'site-packages' and os.path.splitext(fn)[0] in REQUIRED_MODULES:
  635. copyfile(join(stdlib_dir, fn), join(lib_dir, fn))
  636. finally:
  637. logger.indent -= 2
  638. mkdir(join(lib_dir, 'site-packages'))
  639. writefile(join(lib_dir, 'site.py'), SITE_PY)
  640. writefile(join(lib_dir, 'orig-prefix.txt'), prefix)
  641. site_packages_filename = join(lib_dir, 'no-global-site-packages.txt')
  642. if not site_packages:
  643. writefile(site_packages_filename, '')
  644. else:
  645. if os.path.exists(site_packages_filename):
  646. logger.info('Deleting %s' % site_packages_filename)
  647. os.unlink(site_packages_filename)
  648. stdinc_dir = join(prefix, 'include', py_version)
  649. if os.path.exists(stdinc_dir):
  650. copyfile(stdinc_dir, inc_dir)
  651. else:
  652. logger.debug('No include dir %s' % stdinc_dir)
  653. if sys.exec_prefix != prefix:
  654. if sys.platform == 'win32':
  655. exec_dir = join(sys.exec_prefix, 'lib')
  656. elif is_jython:
  657. exec_dir = join(sys.exec_prefix, 'Lib')
  658. else:
  659. exec_dir = join(sys.exec_prefix, 'lib', py_version)
  660. for fn in os.listdir(exec_dir):
  661. copyfile(join(exec_dir, fn), join(lib_dir, fn))
  662. if is_jython:
  663. # Jython has either jython-dev.jar and javalib/ dir, or just
  664. # jython.jar
  665. for name in 'jython-dev.jar', 'javalib', 'jython.jar':
  666. src = join(prefix, name)
  667. if os.path.exists(src):
  668. copyfile(src, join(home_dir, name))
  669. # XXX: registry should always exist after Jython 2.5rc1
  670. src = join(prefix, 'registry')
  671. if os.path.exists(src):
  672. copyfile(src, join(home_dir, 'registry'), symlink=False)
  673. copyfile(join(prefix, 'cachedir'), join(home_dir, 'cachedir'),
  674. symlink=False)
  675. mkdir(bin_dir)
  676. py_executable = join(bin_dir, os.path.basename(sys.executable))
  677. if 'Python.framework' in prefix:
  678. if py_executable.endswith('/Python'):
  679. # The name of the python executable is not quite what
  680. # we want, rename it.
  681. py_executable = os.path.join(
  682. os.path.dirname(py_executable), 'python')
  683. logger.notify('New %s executable in %s', expected_exe, py_executable)
  684. if sys.executable != py_executable:
  685. ## FIXME: could I just hard link?
  686. executable = sys.executable
  687. if sys.platform == 'cygwin' and os.path.exists(executable + '.exe'):
  688. # Cygwin misreports sys.executable sometimes
  689. executable += '.exe'
  690. py_executable += '.exe'
  691. logger.info('Executable actually exists in %s' % executable)
  692. shutil.copyfile(executable, py_executable)
  693. make_exe(py_executable)
  694. if sys.platform == 'win32' or sys.platform == 'cygwin':
  695. pythonw = os.path.join(os.path.dirname(sys.executable), 'pythonw.exe')
  696. if os.path.exists(pythonw):
  697. logger.info('Also created pythonw.exe')
  698. shutil.copyfile(pythonw, os.path.join(os.path.dirname(py_executable), 'pythonw.exe'))
  699. if os.path.splitext(os.path.basename(py_executable))[0] != expected_exe:
  700. secondary_exe = os.path.join(os.path.dirname(py_executable),
  701. expected_exe)
  702. py_executable_ext = os.path.splitext(py_executable)[1]
  703. if py_executable_ext == '.exe':
  704. # python2.4 gives an extension of '.4' :P
  705. secondary_exe += py_executable_ext
  706. if os.path.exists(secondary_exe):
  707. logger.warn('Not overwriting existing %s script %s (you must use %s)'
  708. % (expected_exe, secondary_exe, py_executable))
  709. else:
  710. logger.notify('Also creating executable in %s' % secondary_exe)
  711. shutil.copyfile(sys.executable, secondary_exe)
  712. make_exe(secondary_exe)
  713. if 'Python.framework' in prefix:
  714. logger.debug('MacOSX Python framework detected')
  715. # Make sure we use the the embedded interpreter inside
  716. # the framework, even if sys.executable points to
  717. # the stub executable in ${sys.prefix}/bin
  718. # See http://groups.google.com/group/python-virtualenv/
  719. # browse_thread/thread/17cab2f85da75951
  720. shutil.copy(
  721. os.path.join(
  722. prefix, 'Resources/Python.app/Contents/MacOS/Python'),
  723. py_executable)
  724. # Copy the framework's dylib into the virtual
  725. # environment
  726. virtual_lib = os.path.join(home_dir, '.Python')
  727. if os.path.exists(virtual_lib):
  728. os.unlink(virtual_lib)
  729. copyfile(
  730. os.path.join(prefix, 'Python'),
  731. virtual_lib)
  732. # And then change the install_name of the copied python executable
  733. try:
  734. call_subprocess(
  735. ["install_name_tool", "-change",
  736. os.path.join(prefix, 'Python'),
  737. '@executable_path/../.Python',
  738. py_executable])
  739. except:
  740. logger.fatal(
  741. "Could not call install_name_tool -- you must have Apple's development tools installed")
  742. raise
  743. # Some tools depend on pythonX.Y being present
  744. py_executable_version = '%s.%s' % (
  745. sys.version_info[0], sys.version_info[1])
  746. if not py_executable.endswith(py_executable_version):
  747. # symlinking pythonX.Y > python
  748. pth = py_executable + '%s.%s' % (
  749. sys.version_info[0], sys.version_info[1])
  750. if os.path.exists(pth):
  751. os.unlink(pth)
  752. os.symlink('python', pth)
  753. else:
  754. # reverse symlinking python -> pythonX.Y (with --python)
  755. pth = join(bin_dir, 'python')
  756. if os.path.exists(pth):
  757. os.unlink(pth)
  758. os.symlink(os.path.basename(py_executable), pth)
  759. if sys.platform == 'win32' and ' ' in py_executable:
  760. # There's a bug with subprocess on Windows when using a first
  761. # argument that has a space in it. Instead we have to quote
  762. # the value:
  763. py_executable = '"%s"' % py_executable
  764. cmd = [py_executable, '-c', 'import sys; print sys.prefix']
  765. logger.info('Testing executable with %s %s "%s"' % tuple(cmd))
  766. proc = subprocess.Popen(cmd,
  767. stdout=subprocess.PIPE)
  768. proc_stdout, proc_stderr = proc.communicate()
  769. proc_stdout = os.path.normcase(os.path.abspath(proc_stdout.strip()))
  770. if proc_stdout != os.path.normcase(os.path.abspath(home_dir)):
  771. logger.fatal(
  772. 'ERROR: The executable %s is not functioning' % py_executable)
  773. logger.fatal(
  774. 'ERROR: It thinks sys.prefix is %r (should be %r)'
  775. % (proc_stdout, os.path.normcase(os.path.abspath(home_dir))))
  776. logger.fatal(
  777. 'ERROR: virtualenv is not compatible with this system or executable')
  778. if sys.platform == 'win32':
  779. logger.fatal(
  780. 'Note: some Windows users have reported this error when they installed Python for "Only this user". The problem may be resolvable if you install Python "For all users". (See https://bugs.launchpad.net/virtualenv/+bug/352844)')
  781. sys.exit(100)
  782. else:
  783. logger.info('Got sys.prefix result: %r' % proc_stdout)
  784. pydistutils = os.path.expanduser('~/.pydistutils.cfg')
  785. if os.path.exists(pydistutils):
  786. logger.notify('Please make sure you remove any previous custom paths from '
  787. 'your %s file.' % pydistutils)
  788. ## FIXME: really this should be calculated earlier
  789. return py_executable
  790. def install_activate(home_dir, bin_dir):
  791. if sys.platform == 'win32' or is_jython and os._name == 'nt':
  792. files = {'activate.bat': ACTIVATE_BAT,
  793. 'deactivate.bat': DEACTIVATE_BAT}
  794. if os.environ.get('OS') == 'Windows_NT' and os.environ.get('OSTYPE') == 'cygwin':
  795. files['activate'] = ACTIVATE_SH
  796. else:
  797. files = {'activate': ACTIVATE_SH}
  798. files['activate_this.py'] = ACTIVATE_THIS
  799. for name, content in files.items():
  800. content = content.replace('__VIRTUAL_ENV__', os.path.abspath(home_dir))
  801. content = content.replace('__VIRTUAL_NAME__', os.path.basename(os.path.abspath(home_dir)))
  802. content = content.replace('__BIN_NAME__', os.path.basename(bin_dir))
  803. writefile(os.path.join(bin_dir, name), content)
  804. def install_distutils(lib_dir, home_dir):
  805. distutils_path = os.path.join(lib_dir, 'distutils')
  806. mkdir(distutils_path)
  807. ## FIXME: maybe this prefix setting should only be put in place if
  808. ## there's a local distutils.cfg with a prefix setting?
  809. home_dir = os.path.abspath(home_dir)
  810. ## FIXME: this is breaking things, removing for now:
  811. #distutils_cfg = DISTUTILS_CFG + "\n[install]\nprefix=%s\n" % home_dir
  812. writefile(os.path.join(distutils_path, '__init__.py'), DISTUTILS_INIT)
  813. writefile(os.path.join(distutils_path, 'distutils.cfg'), DISTUTILS_CFG, overwrite=False)
  814. def fix_lib64(lib_dir):
  815. """
  816. Some platforms (particularly Gentoo on x64) put things in lib64/pythonX.Y
  817. instead of lib/pythonX.Y. If this is such a platform we'll just create a
  818. symlink so lib64 points to lib
  819. """
  820. if [p for p in distutils.sysconfig.get_config_vars().values()
  821. if isinstance(p, basestring) and 'lib64' in p]:
  822. logger.debug('This system uses lib64; symlinking lib64 to lib')
  823. assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], (
  824. "Unexpected python lib dir: %r" % lib_dir)
  825. lib_parent = os.path.dirname(lib_dir)
  826. assert os.path.basename(lib_parent) == 'lib', (
  827. "Unexpected parent dir: %r" % lib_parent)
  828. copyfile(lib_parent, os.path.join(os.path.dirname(lib_parent), 'lib64'))
  829. def resolve_interpreter(exe):
  830. """
  831. If the executable given isn't an absolute path, search $PATH for the interpreter
  832. """
  833. if os.path.abspath(exe) != exe:
  834. paths = os.environ.get('PATH', '').split(os.pathsep)
  835. for path in paths:
  836. if os.path.exists(os.path.join(path, exe)):
  837. exe = os.path.join(path, exe)
  838. break
  839. if not os.path.exists(exe):
  840. logger.fatal('The executable %s (from --python=%s) does not exist' % (exe, exe))
  841. sys.exit(3)
  842. return exe
  843. ############################################################
  844. ## Relocating the environment:
  845. def make_environment_relocatable(home_dir):
  846. """
  847. Makes the already-existing environment use relative paths, and takes out
  848. the #!-based environment selection in scripts.
  849. """
  850. activate_this = os.path.join(home_dir, 'bin', 'activate_this.py')
  851. if not os.path.exists(activate_this):
  852. logger.fatal(
  853. 'The environment doesn\'t have a file %s -- please re-run virtualenv '
  854. 'on this environment to update it' % activate_this)
  855. fixup_scripts(home_dir)
  856. fixup_pth_and_egg_link(home_dir)
  857. ## FIXME: need to fix up distutils.cfg
  858. OK_ABS_SCRIPTS = ['python', 'python%s' % sys.version[:3],
  859. 'activate', 'activate.bat', 'activate_this.py']
  860. def fixup_scripts(home_dir):
  861. # This is what we expect at the top of scripts:
  862. shebang = '#!%s/bin/python' % os.path.normcase(os.path.abspath(home_dir))
  863. # This is what we'll put:
  864. new_shebang = '#!/usr/bin/env python%s' % sys.version[:3]
  865. activate = "import os; activate_this=os.path.join(os.path.dirname(__file__), 'activate_this.py'); execfile(activate_this, dict(__file__=activate_this)); del os, activate_this"
  866. bin_dir = os.path.join(home_dir, 'bin')
  867. for filename in os.listdir(bin_dir):
  868. filename = os.path.join(bin_dir, filename)
  869. if not os.path.isfile(filename):
  870. # ignore subdirs, e.g. .svn ones.
  871. continue
  872. f = open(filename, 'rb')
  873. lines = f.readlines()
  874. f.close()
  875. if not lines:
  876. logger.warn('Script %s is an empty file' % filename)
  877. continue
  878. if not lines[0].strip().startswith(shebang):
  879. if os.path.basename(filename) in OK_ABS_SCRIPTS:
  880. logger.debug('Cannot make script %s relative' % filename)
  881. elif lines[0].strip() == new_shebang:
  882. logger.info('Script %s has already been made relative' % filename)
  883. else:
  884. logger.warn('Script %s cannot be made relative (it\'s not a normal script that starts with %s)'
  885. % (filename, shebang))
  886. continue
  887. logger.notify('Making script %s relative' % filename)
  888. lines = [new_shebang+'\n', activate+'\n'] + lines[1:]
  889. f = open(filename, 'wb')
  890. f.writelines(lines)
  891. f.close()
  892. def fixup_pth_and_egg_link(home_dir, sys_path=None):
  893. """Makes .pth and .egg-link files use relative paths"""
  894. home_dir = os.path.normcase(os.path.abspath(home_dir))
  895. if sys_path is None:
  896. sys_path = sys.path
  897. for path in sys_path:
  898. if not path:
  899. path = '.'
  900. if not os.path.isdir(path):
  901. continue
  902. path = os.path.normcase(os.path.abspath(path))
  903. if not path.startswith(home_dir):
  904. logger.debug('Skipping system (non-environment) directory %s' % path)
  905. continue
  906. for filename in os.listdir(path):
  907. filename = os.path.join(path, filename)
  908. if filename.endswith('.pth'):
  909. if not os.access(filename, os.W_OK):
  910. logger.warn('Cannot write .pth file %s, skipping' % filename)
  911. else:
  912. fixup_pth_file(filename)
  913. if filename.endswith('.egg-link'):
  914. if not os.access(filename, os.W_OK):
  915. logger.warn('Cannot write .egg-link file %s, skipping' % filename)
  916. else:
  917. fixup_egg_link(filename)
  918. def fixup_pth_file(filename):
  919. lines = []
  920. prev_lines = []
  921. f = open(filename)
  922. prev_lines = f.readlines()
  923. f.close()
  924. for line in prev_lines:
  925. line = line.strip()
  926. if (not line or line.startswith('#') or line.startswith('import ')
  927. or os.path.abspath(line) != line):
  928. lines.append(line)
  929. else:
  930. new_value = make_relative_path(filename, line)
  931. if line != new_value:
  932. logger.debug('Rewriting path %s as %s (in %s)' % (line, new_value, filename))
  933. lines.append(new_value)
  934. if lines == prev_lines:
  935. logger.info('No changes to .pth file %s' % filename)
  936. return
  937. logger.notify('Making paths in .pth file %s relative' % filename)
  938. f = open(filename, 'w')
  939. f.write('\n'.join(lines) + '\n')
  940. f.close()
  941. def fixup_egg_link(filename):
  942. f = open(filename)
  943. link = f.read().strip()
  944. f.close()
  945. if os.path.abspath(link) != link:
  946. logger.debug('Link in %s already relative' % filename)
  947. return
  948. new_link = make_relative_path(filename, link)
  949. logger.notify('Rewriting link %s in %s as %s' % (link, filename, new_link))
  950. f = open(filename, 'w')
  951. f.write(new_link)
  952. f.close()
  953. def make_relative_path(source, dest, dest_is_directory=True):
  954. """
  955. Make a filename relative, where the filename is dest, and it is
  956. being referred to from the filename source.
  957. >>> make_relative_path('/usr/share/something/a-file.pth',
  958. ... '/usr/share/another-place/src/Directory')
  959. '../another-place/src/Directory'
  960. >>> make_relative_path('/usr/share/something/a-file.pth',
  961. ... '/home/user/src/Directory')
  962. '../../../home/user/src/Directory'
  963. >>> make_relative_path('/usr/share/a-file.pth', '/usr/share/')
  964. './'
  965. """
  966. source = os.path.dirname(source)
  967. if not dest_is_directory:
  968. dest_filename = os.path.basename(dest)
  969. dest = os.path.dirname(dest)
  970. dest = os.path.normpath(os.path.abspath(dest))
  971. source = os.path.normpath(os.path.abspath(source))
  972. dest_parts = dest.strip(os.path.sep).split(os.path.sep)
  973. source_parts = source.strip(os.path.sep).split(os.path.sep)
  974. while dest_parts and source_parts and dest_parts[0] == source_parts[0]:
  975. dest_parts.pop(0)
  976. source_parts.pop(0)
  977. full_parts = ['..']*len(source_parts) + dest_parts
  978. if not dest_is_directory:
  979. full_parts.append(dest_filename)
  980. if not full_parts:
  981. # Special case for the current directory (otherwise it'd be '')
  982. return './'
  983. return os.path.sep.join(full_parts)
  984. ############################################################
  985. ## Bootstrap script creation:
  986. def create_bootstrap_script(extra_text, python_version=''):
  987. """
  988. Creates a bootstrap script, which is like this script but with
  989. extend_parser, adjust_options, and after_install hooks.
  990. This returns a string that (written to disk of course) can be used
  991. as a bootstrap script with your own customizations. The script
  992. will be the standard virtualenv.py script, with your extra text
  993. added (your extra text should be Python code).
  994. If you include these functions, they will be called:
  995. ``extend_parser(optparse_parser)``:
  996. You can add or remove options from the parser here.
  997. ``adjust_options(options, args)``:
  998. You can change options here, or change the args (if you accept
  999. different kinds of arguments, be sure you modify ``args`` so it is
  1000. only ``[DEST_DIR]``).
  1001. ``after_install(options, home_dir)``:
  1002. After everything is installed, this function is called. This
  1003. is probably the function you are most likely to use. An
  1004. example would be::
  1005. def after_install(options, home_dir):
  1006. subprocess.call([join(home_dir, 'bin', 'easy_install'),
  1007. 'MyPackage'])
  1008. subprocess.call([join(home_dir, 'bin', 'my-package-script'),
  1009. 'setup', home_dir])
  1010. This example immediately installs a package, and runs a setup
  1011. script from that package.
  1012. If you provide something like ``python_version='2.4'`` then the
  1013. script will start with ``#!/usr/bin/env python2.4`` instead of
  1014. ``#!/usr/bin/env python``. You can use this when the script must
  1015. be run with a particular Python version.
  1016. """
  1017. filename = __file__
  1018. if filename.endswith('.pyc'):
  1019. filename = filename[:-1]
  1020. f = open(filename, 'rb')
  1021. content = f.read()
  1022. f.close()
  1023. py_exe = 'python%s' % python_version
  1024. content = (('#!/usr/bin/env %s\n' % py_exe)
  1025. + '## WARNING: This file is generated\n'
  1026. + content)
  1027. return content.replace('##EXT' 'END##', extra_text)
  1028. ##file site.py
  1029. SITE_PY = """
  1030. eJzVPP1z2zaWv/OvwNKToZTKdJ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agx054da+F88wLwhqN9SFS68bi
  1123. Y6CG+KUr8SF0pDF6TTSSEEpmeImGH8fhsA2aCMrswp+n19uFmxjWtyFogV1M21WP/OFW6ayZzhqe
  1124. y0yE2ondCXNpLEsTtZnN3btT73OhXyoA6oQy/XKZNFktZA5RBYW5dLsbtKp73YnlhLmFdTndAaJE
  1125. RbZNdsqpNUmUCHHWkC6o4pEE5cwgCv0huWbdi/ewRMN3EQE6IUqxQ+EMVc18zXLM4YBWd72j922a
  1126. f/ki6hGZJ+UYcd46cbBOdJkYo5Ws9fr5wWh8+bw1o5SXnXu3/+YlWBiXUw5AfZZPnz4NxX/cb/kZ
  1127. lTgrimtwSQD2UEAoLqh5j83Wi7O71fdqTUsMLDlfy0t4cEX5Y/u8ySk5d8dQ2hBp/xoYEe5NZPnR
  1128. 9O/YQE5bVXzUyj34yEbbjp/ylF4dgskViSpXv4EFEy9GoIglQTdEiZqnacSBOuzHrmjwnhIm2jS/
  1129. yFvg+BTBTLAVz4g4zFyjd0Uli5Z7LDonIiTAIZUQ8Wx085Fu6gCe0w87jeb0PE/rtsb+mXt8qO/i
  1130. 1vaNIJqvRLJFyTDr6BDDufLmsWrrXRZ3sqjnrRfzSzfl1lklN9+HO7A2SFqxXBpM4aHZpHkhq7kx
  1131. qrhj6TytHTCmH8LhwfQiFDJAcTCAUggangzDwkq0bf2T3RcX0/d0knpoZtIFNLV9uQynR5K8U0cW
  1132. x+38lIixhLR8a76MYZZ3lNjV/oA3l/iTTitigbV3B9696tXk+m47VzC0F94BDr1PxSpIy46ejnBe
  1133. 4mPhM9NqR769Cu/Ug2N4SrjdpFXdJNlU37+eoss2tUfLGk97RejOy2/WZwGHugBX81AXS4PvYOpM
  1134. kJ5Y62jK1SE+1+F57F678W+olAX6ei88PY5J32d82dvR4NjzC3Nx4yEq31wf6FXeu1hOqKonGndr
  1135. FXu98AQh0jVflJYd8rAfNaWB5brCDwWQAQD4w45f9EXnFMgpTeO60X2p/x7Qr7+6C6yrZAaLZinf
  1136. 7isefXHJrWJtE/4sy8bnW4NbiZKxMFdNteDxrTyUElb59iaxqXXoXoiA5ocv+Y4FP+A0LcLJDp+o
  1137. SLvZhiPvopXF7y5StZ2C30UlPWqYVujmYZnhOuEWFNemPLbBEF/VyilFO3KLT/BTXw+WZSf4UhYk
  1138. 6GF9Hd21fB5/19p1j8Cu3Jy99NbuX79waaDH7ueXIRqwC6oJ8aCKTovR9F8juhN9LDic3tCfpX09
  1139. HGc5iAc1ahPNkptk7n7Hw+lDfrtcWx/oXI5wd72zpr3Xhg079zm5z818EIfP7f03Ol1daPZig0Xv
  1140. Gplyvc5UrlZqmuCraqbk5dDZcs98Gbv5ll5TIhO1M+YOb9QDCMMqugrILfSDXQdPil+Zx0ezztVp
  1141. QVNTAZNTEaXSBUev2rYCuJijVhpvkiJc0hRmEvMNqqnKCtyRUL9Yjc8Mh8qsWqAmgtok6tqgbkZM
  1142. 9Hu2cAo+qDbXbzhWZhfHow4Qgqvynfd2cI3gdGrbgF+etRcB04llCJk3G4iP6/YOvH82kYpvnRno
  1143. 0hVusBMjtWLX4RQXsdTyh4MURin2+xfa/HvezR23/8ZWpT2crWiEDr8fc7HQkXLDzemtfSmM++6F
  1144. Bb2vjyIifneCsN1a7rP3/mEr/qpf+kCKUAct3KpfMsEvzuKsClZkOXwEcu9eefAr46zOYofBouE8
  1145. cxVD/60CeGuODO3Q23N6XNB/T47PDO38vt6wzNLLRO/pbKl4wj0GFU8727h15bGI5R5X3i9UfKQr
  1146. 78F/oCuv33UE1kTjo/XBYOniPT4/qwn3xUEtI8CYKRAJk+2dt+wYezhyCwHBIU9vQ/uWPNaZzu0C
  1147. YyaQI/sv0CAQP3Dljls15b2vxMw75Gv70kWPv7t4/+r0gmgx/XD6+j9Pv6MjYsxbdWzWg2OdvDhk
  1148. ah96JWlu3KOP9YYmb7EdeGcW11VrCL323pHIAIThGvqhDe0qMrd534BeLXJ/ECB+97I7UPep7EHI
  1149. PedL1726h3md2rFAP+VCH/PLOZcxj0zWlMWhTYma9jaLpWW0F+Tv2zin5KavTrRTql9VtScBMbaF
  1150. X7QDmLxC/rK5K1PFazMk7Kh0311M1Wp4A8Lc8wYpnEvndUP0piEGVfsvSa5A2SWYg2eHcWJfOEj9
  1151. OE+n7Js0MQ8/l7EhiHcFIeyvzxX2hcz2UCEIWOHpl+kwIkb/6cy2PQ16osTlIV12OkRlc2V/4Z5p
  1152. J/fnFM98avtWCmWOSzHfDZ2XTeae49gxvQHk/FFasFg61bWg+Y6Azq14KmBv9JlYIc52IoIoUR9W
  1153. YMEO0VG/UcZBHu2mg72h1TNxuO8qjHsVRIjn+zsuOrdN9IgXPELdM0I15sKBY4GxZmTfHRfxLUHm
  1154. vLKg11B4zgeeZ+iX/MHXm8vnxzYpifyOze5LDpD2oWPYL9uq8jtffOSMJl6pJlQ7gIUq4y74q9Bh
  1155. zaXYH+D0amT3BEHmwIkhhV778Lm6GeG9TDTsImr57hgWJEZP1JgW5VQVa9ztk3Fvsa3K6sPgAun7
  1156. YfS0H4BCKMO+CX74XRugnp/peHDW0NvirMOJ1wodeaBDcp8XeITx+lrsusPpWtODhlO5uC0y5w5d
  1157. 3tP7DWLNXgP38hId+21Bd+UtD+yx/XxBbHj88weM75dT2OEv7nKoba8vBy8lsBOLBTh4PNuhkHkc
  1158. g3UBhTkiNY21m0bC8eJ3S0aHm9qlIVegw0c1PfgmSAosyImdastvjUHwfz3zySQ=
  1159. """.decode("base64").decode("zlib")
  1160. ##file ez_setup.py
  1161. EZ_SETUP_PY = """
  1162. eJzNWmuP28YV/a5fwShYSIJlLt8PGXKRJi5gIEiDPAoU9lY7zxVrilRJyhu1yH/vmeFDJLVU2iIf
  1163. ysDZXXJ45z7PuXekL784nqt9ns3m8/kf87wqq4IcjVJUp2OV52lpJFlZkTQlVYJFs/fSOOcn45lk
  1164. lVHlxqkUw7XqaWEcCftEnsSirB+ax/Pa+PuprLCApScujGqflDOZpEK9Uu0hhByEwZNCsCovzsZz
  1165. Uu2NpFobJOMG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fNPA1Ev5eB01nyToCQS
  1205. elIM/l1e/SkHL9zO55ppXyrr35tuVfGjPAc8+80LpKrLmFxIwUhzVrckGj5rG5KqPiHWLcb/KcnW
  1206. EK0+A2hJ9rc4Vt1Tu14TbI37jxfOnODFvGbDlgwVqbDqRNKLEQ3JDImk/YihANdQB9m6RwqldZ61
  1207. /erW6IHZ67sSvfddqVrveb9wRkfgda5Cbp87lM+MV8MWsSSfBbTfoiWvSeHveZItWwppl9biyoIp
  1208. cbpP/g5s3rbWCqra11GkZVUua7GrjSqwrz7niUqgoyCKL1t1yq4+BniuLp2KHIKUN8rWS2n+NFil
  1209. mnEVl+G76sJK85kU2VL5+fXvd9WfkDTA2iB5+VKW3+mUUJ+cLMVnkak/YM4Rys72Ij2qvu99nW29
  1210. 3qNLFTQnKv/VZztL5YoZKGFtAF1m6tYB5ZwJOBKvoA5V5wuEFs8KjwnG2bLUb/c5QCO4OWu2BHQ3
  1211. Pc5lR6jM22w2Z7MlQExslIe1mANhe9Vu8VzUxLRHeKFE9ZwXn5pN18axZpecVqT5XE4hhUaJu3I2
  1212. UygCDzDdtesFkHypxKZyCtGwVd8Ac/V7RhFJsb5KmR7oXjVUOsvWqpquXkNHoZO1StRk2TROqRDH
  1213. N/WP5aj3GmZnC8OaF8u53mLEe7rkGnww8TM/imx5texL4wc0/ffPRVIBfBBj+Fe328DwT2v10eCz
  1214. ip5qF1ihyhDQyPKiOOnkSMVImI57Pz1UF14Jvb7FxPZqPmabGsJhgKkGkuVqqHGNItqaGivW82c6
  1215. hzvxwNR21GN49xKGQTUUbsYQgA02eheW5qVYrq4goqw2Wmj/ecNmLWhBwVT90sLW7D+5FH8fkOlL
  1216. NCyf11OMfeHc97c+NNUc+w6tVbOqJYiXmunRh9G3Oul6eOiw+kriZc3tAUNP6tZ1SzYcIwZThI6Z
  1217. Ko3e7MDywwGGmoMesj3OIc1A1l5NjLSLU3CB9vPqlTpteVjpNH0Wi0KntTAUjf9mqihLlZ9HXKXU
  1218. vuYQLDplmAA/LTuzhg1n0m/czd2u8dZuZ2wxElqmZdqL/3pE+CsAXoOrmotpmacCtToxGrdNP8ik
  1219. buyvGvpCHPLPGm91JOrvPOgJGMxRAXrT38DdUac+2ZI3RfWPYbPSm7z63c71MPgfDHT4eaP/Hk1t
  1220. m+ls/59T8laZdYJ/U8pVNr9Ud225PQxndu1sa4XEh1WK/RE4pjNFPXk5Q9Uuv5MDOvW15jemsDrN
  1221. 5z9etUXzdYsoc4DgkyaiQh3/IgnRJF0Sev6CvMXyB7RT8/bbOebxPJw+5/X3bq6/mmKuFs2x5rHj
  1222. p3aEKS/w/LN+aqgSoackrV7X58QQ+aSGu7NC5H4WF838o3qt9ly5E3txiO65L921+lOtWF66ai2k
  1223. 5UJNmouCLi7PumNm9e5Dc0QtW1J98ZhadmRXj4A1RX+Yqz/uig3+rYEVGB+aTrNuyNqNTJDvoVyu
  1224. HrqXzRIWd9R5VEPFfF5PCjVJ9x2DCGCErNqJQX+faNveNZ9EVRetur/sT+c73THsdk3Wdy5pZKwN
  1225. 7ZY3TUvUOuDN2NgDqTANbqGnWQpSsP1y/jHrfx/oY7b88LdfH16tfp3r9mTVH2P02z0segGxQeT6
  1226. G1mpIRQKfDG/LtIWEWtV8f8PGy3Y1K330l49YAzTjnyln9YPMbri0ebhZfMXz01OyKY96lTvOWAG
  1227. M1o/breL3U4V7G636D4FSZVEqKlr+K2j6bD9+4P9gHdev4az6lLp0VevdrrlzubhJV7UGHGRqRbV
  1228. 178BYnMUkw==
  1229. """.decode("base64").decode("zlib")
  1230. ##file distribute_setup.py
  1231. DISTRIBUTE_SETUP_PY = """
  1232. eJztG2tz2zbyO38FTh4PqYSm7bT3GM+pc2nj9DzNJZnYaT8kGRoiIYk1X+XDsvrrb3cBkCAJyUnb
  1233. u5mbOd3VoYjFYrHvXUBHfyp3zabIndls9m1RNHVT8ZLFCfybLNtGsCSvG56mvEkAyLlasV3Rsi3P
  1234. G9YUrK0Fq0XTlk1RpDXA4mjFSh7d8bVwazkYlDuf/dzWDQBEaRsL1myS2lklKaKHL4CEZwJWrUTU
  1235. FNWObZNmw5LGZzyPGY9jmoALImxTlKxYyZU0/osLx2HwWVVFZlAf0jhLsrKoGqQ27Kkl+OErbz7Z
  1236. YSV+aYEsxlldiihZJRG7F1UNzEAa+qk+PgNUXGzztOCxkyVVVVQ+KyriEs8ZTxtR5Rx4qoH6Hfu0
  1237. aARQccHqgi13rG7LMt0l+drBTfOyrIqySnB6UaIwiB+3t+Md3N4GjnOD7CL+RrQwYhSsauG5xq1E
  1238. VVLS9pR0icpyXfHYlGeASuEo5hW1fqp33WOTZEI/r/KMN9GmGxJZiRR033lFXzsJtU2CKiNH02Lt
  1239. OE21u+ilWCeofXL4/fXlu/D66ubSEQ+RANKv6P0lslhO6SDYgr0ucmFg02S3S2BhJOpaqkosViyU
  1240. yh9GWew94dW6nssp+MGvgMyD7QbiQURtw5ep8OfsKQ11cBXwq8oN9EEEHPUIG1ss2Jmzl+gjUHRg
  1241. PogGpBizFUhBEsSeBV/9oUQesV/aogFlwtdtJvIGWL+C5XPQxR4MXiGmEswdiMmQfBdgvnrm9ktq
  1242. shChwG3Oh2MKjwv/A+OG8emwwTZ3dlzPXHaMgBM4BTMeUpv+0FNArIMHtWL9aSydog7qkoPVefD0
  1243. Nvzp+dWNz0ZMY09Mmb24fPn8/aub8MfLd9dXb17DerOz4C/B+dmsG3r/7hW+3jRNeXF6Wu7KJJCi
  1244. CopqfaqcYH1ag6OKxGl82vul05lzfXnz/u3NmzevrsOXz3+4fDFaKDo/nzkm0Nsfvg+vXr98g+Oz
  1245. 2UfnX6LhMW/4yY/SHV2w8+DMeQ1+9MIwYacbPa6d6zbLOFgFe4CP888iEyclUEjfnectUF6Zzyci
  1246. 40kq37xKIpHXCvSFkA6E8OILIAgkuG9HjuOQGitf44EnWMK/c20D4gFiTkTKSe5dDtNgk5XgImHL
  1247. 2psE2V2Mz+CpcRzcRrDlVe65lz0S0IHj2vXVZAlYpHG4jQERiH8tm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SMPdfq6U03XDu+FjhjX8v3QIGDN+6SQjb7JIYj+lLwe1k9jnEFYpFjiTd93yB+Z38EBFvscpUYw
  1275. TpLRrx+rlfppUtv281HJUEtlwP5HPYVaZsq7w1u1MtKaMNshTeUzdcdx/mF+I9WamJEkNhdbHQTx
  1276. LQQ0N3jz6kVwXOPpER5EBvhn0kR9h+hkHEGfXcj2nTQOjVP1U7GMxK+ebVRRr186mtisuIe8FDgV
  1277. ms1or0x5JDawd6GbwqOImdTY1puCDal/n99BzBn0uSHHUXsw5u53WStM8Tu1km8qps/ejZ6rnRSg
  1278. Wh3sBupfD+f6ZuvjCTbnTjAPH7ch9OIDU8DPEvzOncmW1bAS6TnQNyMpWzbPp811RwxwJloAckIt
  1279. EKmQp59F22B+iQFpy3e9G9clxTg3MtjjE/u6SDSSqJpvcKK3bRUtgexwACuj36AKnUySIVbN8Jnl
  1280. aFA1kRVHJ6becwNMgY+jns+G1FiV6Qgwb1kqGrdmqPhdPB/zs1M0xW/UNc/slvmjPpvqluOhPz4a
  1281. 3NMYDslDwQxOnsYtXQUyKixNbzPBMu0L2PQSfK3skQNbNbGKE3s61u51f2cmNipyd7QTS4jnK0g7
  1282. u6NUnKx2ZCQ0CNLd7Ojau52C94zDtB4w4OkRpA1ZBm44LJY/e/3BXKB7wiWUTlCfyEznsWp84Jks
  1283. Lv5L5g+cp0k7KJelAnnMoVrEpjmlq/GpMyG27e6JYWA8KuZ4n33UIMuofqPkfRemC1UnHXXv0WCB
  1284. jwPt8fadr/uSti9wXyNSJp5M83Lqyqw+RIIf8CBjb/wdyl/G5MmsPl/uXN3hnNnqCAlgf/4sWdVs
  1285. tCT2s8qQUQAT3HF6MdqKQjneinr92FYGZBjtpbG8Ht+fUZp1wabPpY6UCwfPH92h4BP8ZiuV9qqT
  1286. LGYuv//+BBmOrhuYL5+/QJ2SSdFyML7t88WfG88Mn9rHtD11GxCf3XV8G746yIr5I4b4KOf+KxZg
  1287. sMIML7K71sWXSWz5Vnbf9gYXy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TwAcbGdcBucQNud4EAf8oDSFeCCJlctwVCFQfgESar
  1301. Hbno7mSmxVMiIsOfZtGlAuAnkUzdK40HG8RKVUAtlju2Fo3C5c2HJ+0q64mKcmd+h2oGcmx1c0wy
  1302. VF471gCK8f31MpMDoA+fuuCrxTIJunoAA2C6crp8H1YipwNuW4EMyk81rJq3I+M/0oQN6FEXH2q+
  1303. EihVMTr+7SEDXkIZF3tqjaG/0HQtiFsB/jkIiPeOsFXx9dd/owQhSjIQH5UpQN/ZX8/OjIwnXQVK
  1304. 9BqnVP4ucL8T2KMSrEbumyR3Sc6ojcX+zrxnPvva4BDaGM4XlQcYzn3E82xu8zAsykqCCbDSloBB
  1305. f7QyZhsi9SRmO0AlqfdsffMJojuxW2gFDPAeJagv0uwiAe7cZwqbvGKqGQTpEV0IAFydBXdWi6pL
  1306. 4sB8acy8kdIZ4wMi6RDL2hvQAh8yaHIOSFKONkBcL2OFdz4FbOlw7DMAow3s7ACgysJNi/0NtyOl
  1307. iuLkFLifQt15bino8ObpqEq0XdQjZGG8XHughDPlWvAXT3gxRuhwkPGEqtx7n+25DNYHgqtDP4sk
  1308. Fbjk9U5Baed3+Jq4CqTjH0EBcQmdp2OGElLpG4ZIahiq39wR3V2T4/zi09z5N4dES24=
  1309. """.decode("base64").decode("zlib")
  1310. ##file activate.sh
  1311. ACTIVATE_SH = """
  1312. eJytU11P2zAUffevuKQ8AFqJ+srUh6IhgcTKRFgnjSLXTW4aS6ld2U6zgvbfd50PSD+GNI08JLHv
  1313. 8fW5557bg4dMWkhljrAsrIM5QmExgVK6DAKrCxMjzKUKRezkWjgM4Cw1eglzYbMz1oONLiAWSmkH
  1314. plAgHSTSYOzyDWMJtqfg5BReGNAjU3iEvoLgmN/dfuGTm/uH76Nb/m30cB3AE3wGl6GqkP7x28ND
  1315. 0FcE/lpp4yrg616hLDrYO1TFU8mqb6+u3Ga6yBNI0BHnqigQKoFnm32CMpNxBplYIwj6UCjWy6UP
  1316. u0y4Sq8mFakWizwn3ZyGBd1NMtBfqo1frAQJ2xy15wA/SFtduCbspFo0abaAXgg49rwhzoRaoIWS
  1317. miQS/9qAF5yuNWhXxByTHXEvRxHp2df16md0zSdX99HN3fiAyFVpfbMlz9/aFA0OdSka7DWJgHs9
  1318. igbvtqgJtxRqSBu9Gk/eiB0RLyIyhEBplaB1pvBGwx1uPYgwT6EFHO3c3veh1qHt1b8ZmbqOS2Mw
  1319. p+4rB2thpJjnaLue3r6bsQ7VYcB5Z8l5wBoRuvWwPYuSjLW9m0UHHXJ+eTPm49HXK84vGljX/WxX
  1320. TZ/Mt6GSLJiRuVGJJcJ0K+80mFVKEsdd9by1pMjJ2xa9W2FEO4rst5BxM+baSBKlgSNC5tzqIgzL
  1321. sjx/RkdmXZ+ToUOrU1cKg6HwGUL26prHDq0ZpTxIcDqbPUFdC+YW306fvFPUaX2AWtqxH/ugsf+A
  1322. kf/Pcf/3UW/HnBT5Axjqy2Y=
  1323. """.decode("base64").decode("zlib")
  1324. ##file activate.bat
  1325. ACTIVATE_BAT = """
  1326. eJx9kMsOgjAQRfdN+g+zoAn8goZEDESJPBpEViSzkFbZ0IX8f+RRaVW0u5mee3PanbjeFSgpKXmI
  1327. Hqq4KC9BglFW+YjWhEgJJa2ETvXQCNl2ogFe5CkvwaUEhjPm543vcOdAiacjLxzzJFw6f2bZCsZ0
  1328. 2YitXPtswawi1zwgC9II0QPD/RELyuOb1jB/Sg0rNhM31Ss4n2I+7ibLb8epQGco2Rja1Fs/zeoa
  1329. cR9nWnprJaMspOQJdBR1/g==
  1330. """.decode("base64").decode("zlib")
  1331. ##file deactivate.bat
  1332. DEACTIVATE_BAT = """
  1333. eJxzSE3OyFfIT0vj4spMU0hJTcvMS01RiPf3cYkP8wwKCXX0iQ8I8vcNCFHQ4FIAguLUEgWIgK0q
  1334. FlWqXJpcICVYpGzx2OAY4oFsPpCLbjpQCLvZILVcXFaufi5cACHzOrI=
  1335. """.decode("base64").decode("zlib")
  1336. ##file distutils-init.py
  1337. DISTUTILS_INIT = """
  1338. eJytVl2L6zYQffevGBKK7XavKe3bhVBo78uFSyml0IdlEVpbTtR1JCMpm6S/vjOSY0v+uO1DDbs4
  1339. 0tF8nJk5sjz32jjQNpPhzd7H1ys3SqqjhcfCL1q18vgbN1YY2Kc/pQWlHXB4l8ZdeCfUO5x1c+nE
  1340. E1gNVwE1V3CxAqQDp6GVqgF3EmBd08nXLGukUfws4IDBVD13p2pYoS3rLk52ltF6hPhLS1XM4EUc
  1341. VsVYKzvBWPkE+WgmLzPZjkaUNmd6KVI3JRwWoRSLM6P98mMG+Dw4q+il8Ev07P7ATCNmRlfQ8/qN
  1342. HwVwB99Y4H0vMHAi6BWZUoEhoqXTNXdSK+A2LN6tE+fJ0E+7MhOdFSEM5lNgrJIKWXDF908wy87D
  1343. xE3UoHsxkegZTaHIHGNSSYfm+ntelpURvCnK7NEWBI/ap/b8Z1m232N2rj7B60V2DRM3B5NpaLSw
  1344. KnfwpvQVTviHOR+F88lhQyBAGlE7be6DoRNg9ldsG3218IHa6MRNU+tGBEYIggwafRk6yzsXDcVU
  1345. 9Ua08kYxt+F3x12LRaQi52j0xx/ywFxrdMRqVevzmaummlIYEp0WsCAaX8cFb6buuLUTqEgQQ6/Q
  1346. 04iWRoF38m/BdE8VtlBY0bURiB6KG1crpMZwc2fIjqWh+1UrkSLpWUIP8PySwLKv4qPGSVqDuMPy
  1347. dywQ+gS7L1irXVkm5pJsq3l+Ib1lMOvUrxI+/mBBY4KB+WpUtcO06RtzckNvQ6vYj1lGoZM2sdDG
  1348. fryJPYJVn/Cfka8XSqNaoLKhmOlqXMzW9+YBVp1EtIThZtOwzCRvMaARa+0xD0b2kcaJGwJsMbc7
  1349. hLUfY4vKvsCOBdvDnyfuRbzmXRdGTZgPF7oGQkJACWVD22IMQdhx0npt5S2f+pXO+OwH6d+hwiS5
  1350. 7IJOjcK2emj1zBy1aONHByfAMoraw6WlrSIFTbGghqASoRCjVncYROFpXM4uYSqhGnuVeGvks4jz
  1351. cjnCoR5GnPW7KOh4maVbdFeoplgJ3wh3MSrAsv/QuMjOspnTKRl1fTYqqNisv7uTVnhF1GhoBFbp
  1352. lh+OcXN2riA5ZrYXtWxlfcDuC8U5kLoN3CCJYXGpesO6dx6rU0zGMtjU6cNlmW0Fid8Sja4ZG+Z3
  1353. fTPbyj+mZnZ2wSQK8RaT9Km0ySRuLpm0DkUUL0ra3WQ2BgGJ7v9I9SKqNKZ/IR4R28RHm+vEz5ic
  1354. nZ2IH7bfub8pU1PR3gr10W7xLTfHh6Z6bgZ7K14G7Mj/1z5J6MFo6V5e07H0Ou78dTyeI+mxKOpI
  1355. eC2KMSj6HKxd6Uudf/n886fPv+f++x1lbASlmjQuPz8OvGA0j7j2eCu/4bcW6SFeCuNJ0W1GQHI5
  1356. iwC9Ey0bjtHd9P4dPA++XxLnZDVuxvFEtlm3lf5a2c02u2LRYXHH/AOs8pIa
  1357. """.decode("base64").decode("zlib")
  1358. ##file distutils.cfg
  1359. DISTUTILS_CFG = """
  1360. eJxNj00KwkAMhfc9xYNuxe4Ft57AjYiUtDO1wXSmNJnK3N5pdSEEAu8nH6lxHVlRhtDHMPATA4uH
  1361. xJ4EFmGbvfJiicSHFRzUSISMY6hq3GLCRLnIvSTnEefN0FIjw5tF0Hkk9Q5dRunBsVoyFi24aaLg
  1362. 9FDOlL0FPGluf4QjcInLlxd6f6rqkgPu/5nHLg0cXCscXoozRrP51DRT3j9QNl99AP53T2Q=
  1363. """.decode("base64").decode("zlib")
  1364. ##file activate_this.py
  1365. ACTIVATE_THIS = """
  1366. eJx1UsGOnDAMvecrIlYriDRlKvU20h5aaY+teuilGo1QALO4CwlKAjP8fe1QGGalRoLEefbzs+Mk
  1367. Sb7NcvRo3iTcoGqwgyy06As+HWSNVciKaBTFywYoJWc7yit2ndBVwEkHkIzKCV0YdQdmkvShs6YH
  1368. E3IhfjFaaSNLoHxQy2sLJrL0ow98JQmEG/rAYn7OobVGogngBgf0P0hjgwgt7HOUaI5DdBVJkggR
  1369. 3HwSktaqWcCtgiHIH7qHV+esW2CnkRJ+9R5cQGsikkWEV/J7leVGs9TV4TvcO5QOOrTHYI+xeCjY
  1370. JR/m9GPDHv2oSZunUokS2A/WBelnvx6tF6LUJO2FjjlH5zU6Q+Kz/9m69LxvSZVSwiOlGnT1rt/A
  1371. 77j+WDQZ8x9k2mFJetOle88+lc8sJJ/AeerI+fTlQigTfVqJUiXoKaaC3AqmI+KOnivjMLbvBVFU
  1372. 1JDruuadNGcPmkgiBTnQXUGUDd6IK9JEQ9yPdM96xZP8bieeMRqTuqbxIbbey2DjVUNzRs1rosFS
  1373. TsLAdS/0fBGNdTGKhuqD7mUmsFlgGjN2eSj1tM3GnjfXwwCmzjhMbR4rLZXXk+Z/6Hp7Pn2+kJ49
  1374. jfgLHgI4Jg==
  1375. """.decode("base64").decode("zlib")
  1376. if __name__ == '__main__':
  1377. main()
  1378. ## TODO:
  1379. ## Copy python.exe.manifest
  1380. ## Monkeypatch distutils.sysconfig