20
20
$Id$
21
21
"""
22
22
23
- import os , shutil , sys , tempfile , urllib2
23
+ import os
24
+ import shutil
25
+ import sys
26
+ import tempfile
27
+ import urllib2
24
28
from optparse import OptionParser
25
29
26
30
tmpeggs = tempfile .mkdtemp ()
33
37
'intended to meet a temporary need if you encounter problems with '
34
38
'the zc.buildout 1.5 release.' )
35
39
parser .add_option ("-v" , "--version" , dest = "version" , default = '1.4.4' ,
36
- help = 'Use a specific zc.buildout version. *This '
37
- 'bootstrap script defaults to '
38
- '1.4.4, unlike usual buildpout bootstrap scripts.*' )
40
+ help = 'Use a specific zc.buildout version. *This '
41
+ 'bootstrap script defaults to '
42
+ '1.4.4, unlike usual buildpout bootstrap scripts.*' )
39
43
parser .add_option ("-d" , "--distribute" ,
40
- action = "store_true" , dest = "distribute" , default = False ,
41
- help = "Use Disribute rather than Setuptools." )
44
+ action = "store_true" , dest = "distribute" , default = False ,
45
+ help = "Use Disribute rather than Setuptools." )
42
46
43
47
parser .add_option ("-c" , None , action = "store" , dest = "config_file" ,
44
- help = ("Specify the path to the buildout configuration "
45
- "file to be used." ))
48
+ help = ("Specify the path to the buildout configuration "
49
+ "file to be used." ))
46
50
47
51
options , args = parser .parse_args ()
48
52
68
72
ez = {}
69
73
if USE_DISTRIBUTE :
70
74
exec urllib2 .urlopen ('http://python-distribute.org/distribute_setup.py'
71
- ).read () in ez
75
+ ).read () in ez
72
76
ez ['use_setuptools' ](to_dir = tmpeggs , download_delay = 0 , no_fake = True )
73
77
else :
74
78
exec urllib2 .urlopen ('http://peak.telecommunity.com/dist/ez_setup.py'
83
87
if sys .platform == 'win32' :
84
88
def quote (c ):
85
89
if ' ' in c :
86
- return '"%s"' % c # work around spawn lamosity on windows
90
+ return '"%s"' % c # work around spawn lamosity on windows
87
91
else :
88
92
return c
89
93
else :
90
- def quote (c ):
94
+ def quote (c ):
91
95
return c
92
96
93
- ws = pkg_resources .working_set
97
+ ws = pkg_resources .working_set
94
98
95
99
if USE_DISTRIBUTE :
96
100
requirement = 'distribute'
@@ -116,7 +120,7 @@ def quote (c):
116
120
if is_jython :
117
121
import subprocess
118
122
exitcode = subprocess .Popen (cmd , env = env ).wait ()
119
- else : # Windows prefers this, apparently; otherwise we would prefer subprocess
123
+ else : # Windows prefers this, apparently; otherwise we would prefer subprocess
120
124
exitcode = os .spawnle (* ([os .P_WAIT , sys .executable ] + cmd + [env ]))
121
125
assert exitcode == 0
122
126
0 commit comments