Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit72bcdbd

Browse files
committed
Converted all tabs to 4 space characters each to comply with pep8
1 parent4956c1e commit72bcdbd

39 files changed

+9078
-9078
lines changed

‎ez_setup.py

Lines changed: 161 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
If you want to use setuptools in your package's setup.py, just include this
55
file in the same directory with it, and add this to the top of your setup.py::
66
7-
from ez_setup import use_setuptools
8-
use_setuptools()
7+
from ez_setup import use_setuptools
8+
use_setuptools()
99
1010
If you want to require a specific version of setuptools, set a download
1111
mirror, or use an alternate download directory, you can do so by supplying
@@ -15,106 +15,106 @@
1515
"""
1616
importsys
1717
DEFAULT_VERSION="0.6c3"
18-
DEFAULT_URL="http://cheeseshop.python.org/packages/%s/s/setuptools/"%sys.version[:3]
18+
DEFAULT_URL="http://cheeseshop.python.org/packages/%s/s/setuptools/"%sys.version[:3]
1919

2020
md5_data= {
21-
'setuptools-0.6b1-py2.3.egg':'8822caf901250d848b996b7f25c6e6ca',
22-
'setuptools-0.6b1-py2.4.egg':'b79a8a403e4502fbb85ee3f1941735cb',
23-
'setuptools-0.6b2-py2.3.egg':'5657759d8a6d8fc44070a9d07272d99b',
24-
'setuptools-0.6b2-py2.4.egg':'4996a8d169d2be661fa32a6e52e4f82a',
25-
'setuptools-0.6b3-py2.3.egg':'bb31c0fc7399a63579975cad9f5a0618',
26-
'setuptools-0.6b3-py2.4.egg':'38a8c6b3d6ecd22247f179f7da669fac',
27-
'setuptools-0.6b4-py2.3.egg':'62045a24ed4e1ebc77fe039aa4e6f7e5',
28-
'setuptools-0.6b4-py2.4.egg':'4cb2a185d228dacffb2d17f103b3b1c4',
29-
'setuptools-0.6c1-py2.3.egg':'b3f2b5539d65cb7f74ad79127f1a908c',
30-
'setuptools-0.6c1-py2.4.egg':'b45adeda0667d2d2ffe14009364f2a4b',
31-
'setuptools-0.6c2-py2.3.egg':'f0064bf6aa2b7d0f3ba0b43f20817c27',
32-
'setuptools-0.6c2-py2.4.egg':'616192eec35f47e8ea16cd6a122b7277',
33-
'setuptools-0.6c3-py2.3.egg':'f181fa125dfe85a259c9cd6f1d7b78fa',
34-
'setuptools-0.6c3-py2.4.egg':'e0ed74682c998bfb73bf803a50e7b71e',
35-
'setuptools-0.6c3-py2.5.egg':'abef16fdd61955514841c7c6bd98965e',
21+
'setuptools-0.6b1-py2.3.egg':'8822caf901250d848b996b7f25c6e6ca',
22+
'setuptools-0.6b1-py2.4.egg':'b79a8a403e4502fbb85ee3f1941735cb',
23+
'setuptools-0.6b2-py2.3.egg':'5657759d8a6d8fc44070a9d07272d99b',
24+
'setuptools-0.6b2-py2.4.egg':'4996a8d169d2be661fa32a6e52e4f82a',
25+
'setuptools-0.6b3-py2.3.egg':'bb31c0fc7399a63579975cad9f5a0618',
26+
'setuptools-0.6b3-py2.4.egg':'38a8c6b3d6ecd22247f179f7da669fac',
27+
'setuptools-0.6b4-py2.3.egg':'62045a24ed4e1ebc77fe039aa4e6f7e5',
28+
'setuptools-0.6b4-py2.4.egg':'4cb2a185d228dacffb2d17f103b3b1c4',
29+
'setuptools-0.6c1-py2.3.egg':'b3f2b5539d65cb7f74ad79127f1a908c',
30+
'setuptools-0.6c1-py2.4.egg':'b45adeda0667d2d2ffe14009364f2a4b',
31+
'setuptools-0.6c2-py2.3.egg':'f0064bf6aa2b7d0f3ba0b43f20817c27',
32+
'setuptools-0.6c2-py2.4.egg':'616192eec35f47e8ea16cd6a122b7277',
33+
'setuptools-0.6c3-py2.3.egg':'f181fa125dfe85a259c9cd6f1d7b78fa',
34+
'setuptools-0.6c3-py2.4.egg':'e0ed74682c998bfb73bf803a50e7b71e',
35+
'setuptools-0.6c3-py2.5.egg':'abef16fdd61955514841c7c6bd98965e',
3636
}
3737

3838
importsys,os
3939

4040
def_validate_md5(egg_name,data):
41-
ifegg_nameinmd5_data:
42-
frommd5importmd5
43-
digest=md5(data).hexdigest()
44-
ifdigest!=md5_data[egg_name]:
45-
print>>sys.stderr, (
46-
"md5 validation of %s failed! (Possible download problem?)"
47-
%egg_name
48-
)
49-
sys.exit(2)
50-
returndata
41+
ifegg_nameinmd5_data:
42+
frommd5importmd5
43+
digest=md5(data).hexdigest()
44+
ifdigest!=md5_data[egg_name]:
45+
print>>sys.stderr, (
46+
"md5 validation of %s failed! (Possible download problem?)"
47+
%egg_name
48+
)
49+
sys.exit(2)
50+
returndata
5151

5252

5353
defuse_setuptools(
54-
version=DEFAULT_VERSION,download_base=DEFAULT_URL,to_dir=os.curdir,
55-
download_delay=15
54+
version=DEFAULT_VERSION,download_base=DEFAULT_URL,to_dir=os.curdir,
55+
download_delay=15
5656
):
57-
"""Automatically find/download setuptools and make it available on sys.path
58-
59-
`version` should be a valid setuptools version number that is available
60-
as an egg for download under the `download_base` URL (which should end with
61-
a '/'). `to_dir` is the directory where setuptools will be downloaded, if
62-
it is not already available. If `download_delay` is specified, it should
63-
be the number of seconds that will be paused before initiating a download,
64-
should one be required. If an older version of setuptools is installed,
65-
this routine will print a message to ``sys.stderr`` and raise SystemExit in
66-
an attempt to abort the calling script.
67-
"""
68-
try:
69-
importsetuptools
70-
ifsetuptools.__version__=='0.0.1':
71-
print>>sys.stderr, (
72-
"You have an obsolete version of setuptools installed.Please\n"
73-
"remove it from your system entirely before rerunning this script."
74-
)
75-
sys.exit(2)
76-
exceptImportError:
77-
egg=download_setuptools(version,download_base,to_dir,download_delay)
78-
sys.path.insert(0,egg)
79-
importsetuptools;setuptools.bootstrap_install_from=egg
80-
81-
importpkg_resources
82-
try:
83-
pkg_resources.require("setuptools>="+version)
84-
85-
exceptpkg_resources.VersionConflict,e:
86-
# XXX could we install in a subprocess here?
87-
print>>sys.stderr, (
88-
"The required version of setuptools (>=%s) is not available, and\n"
89-
"can't be installed while this script is running. Please install\n"
90-
" a more recent version first.\n\n(Currently using %r)"
91-
)% (version,e.args[0])
92-
sys.exit(2)
57+
"""Automatically find/download setuptools and make it available on sys.path
58+
59+
`version` should be a valid setuptools version number that is available
60+
as an egg for download under the `download_base` URL (which should end with
61+
a '/'). `to_dir` is the directory where setuptools will be downloaded, if
62+
it is not already available. If `download_delay` is specified, it should
63+
be the number of seconds that will be paused before initiating a download,
64+
should one be required. If an older version of setuptools is installed,
65+
this routine will print a message to ``sys.stderr`` and raise SystemExit in
66+
an attempt to abort the calling script.
67+
"""
68+
try:
69+
importsetuptools
70+
ifsetuptools.__version__=='0.0.1':
71+
print>>sys.stderr, (
72+
"You have an obsolete version of setuptools installed.Please\n"
73+
"remove it from your system entirely before rerunning this script."
74+
)
75+
sys.exit(2)
76+
exceptImportError:
77+
egg=download_setuptools(version,download_base,to_dir,download_delay)
78+
sys.path.insert(0,egg)
79+
importsetuptools;setuptools.bootstrap_install_from=egg
80+
81+
importpkg_resources
82+
try:
83+
pkg_resources.require("setuptools>="+version)
84+
85+
exceptpkg_resources.VersionConflict,e:
86+
# XXX could we install in a subprocess here?
87+
print>>sys.stderr, (
88+
"The required version of setuptools (>=%s) is not available, and\n"
89+
"can't be installed while this script is running. Please install\n"
90+
" a more recent version first.\n\n(Currently using %r)"
91+
)% (version,e.args[0])
92+
sys.exit(2)
9393

9494
defdownload_setuptools(
95-
version=DEFAULT_VERSION,download_base=DEFAULT_URL,to_dir=os.curdir,
96-
delay=15
95+
version=DEFAULT_VERSION,download_base=DEFAULT_URL,to_dir=os.curdir,
96+
delay=15
9797
):
98-
"""Download setuptools from a specified location and return its filename
99-
100-
`version` should be a valid setuptools version number that is available
101-
as an egg for download under the `download_base` URL (which should end
102-
with a '/'). `to_dir` is the directory where the egg will be downloaded.
103-
`delay` is the number of seconds to pause before an actual download attempt.
104-
"""
105-
importurllib2,shutil
106-
egg_name="setuptools-%s-py%s.egg"% (version,sys.version[:3])
107-
url=download_base+egg_name
108-
saveto=os.path.join(to_dir,egg_name)
109-
src=dst=None
110-
ifnotos.path.exists(saveto):# Avoid repeated downloads
111-
try:
112-
fromdistutilsimportlog
113-
ifdelay:
114-
log.warn("""
98+
"""Download setuptools from a specified location and return its filename
99+
100+
`version` should be a valid setuptools version number that is available
101+
as an egg for download under the `download_base` URL (which should end
102+
with a '/'). `to_dir` is the directory where the egg will be downloaded.
103+
`delay` is the number of seconds to pause before an actual download attempt.
104+
"""
105+
importurllib2,shutil
106+
egg_name="setuptools-%s-py%s.egg"% (version,sys.version[:3])
107+
url=download_base+egg_name
108+
saveto=os.path.join(to_dir,egg_name)
109+
src=dst=None
110+
ifnotos.path.exists(saveto):# Avoid repeated downloads
111+
try:
112+
fromdistutilsimportlog
113+
ifdelay:
114+
log.warn("""
115115
---------------------------------------------------------------------------
116116
This script requires setuptools version %s to run (even to display
117-
help).I will attempt to download it for you (from
117+
help).I will attempt to download it for you (from
118118
%s), but
119119
you may need to enable firewall access for this script first.
120120
I will start the download in %d seconds.
@@ -125,96 +125,96 @@ def download_setuptools(
125125
126126
and place it in this directory before rerunning this script.)
127127
---------------------------------------------------------------------------""",
128-
version,download_base,delay,url
129-
);fromtimeimportsleep;sleep(delay)
130-
log.warn("Downloading %s",url)
131-
src=urllib2.urlopen(url)
132-
# Read/write all in one block, so we don't create a corrupt file
133-
# if the download is interrupted.
134-
data=_validate_md5(egg_name,src.read())
135-
dst=open(saveto,"wb");dst.write(data)
136-
finally:
137-
ifsrc:src.close()
138-
ifdst:dst.close()
139-
returnos.path.realpath(saveto)
128+
version,download_base,delay,url
129+
);fromtimeimportsleep;sleep(delay)
130+
log.warn("Downloading %s",url)
131+
src=urllib2.urlopen(url)
132+
# Read/write all in one block, so we don't create a corrupt file
133+
# if the download is interrupted.
134+
data=_validate_md5(egg_name,src.read())
135+
dst=open(saveto,"wb");dst.write(data)
136+
finally:
137+
ifsrc:src.close()
138+
ifdst:dst.close()
139+
returnos.path.realpath(saveto)
140140

141141
defmain(argv,version=DEFAULT_VERSION):
142-
"""Install or upgrade setuptools and EasyInstall"""
143-
144-
try:
145-
importsetuptools
146-
exceptImportError:
147-
egg=None
148-
try:
149-
egg=download_setuptools(version,delay=0)
150-
sys.path.insert(0,egg)
151-
fromsetuptools.command.easy_installimportmain
152-
returnmain(list(argv)+[egg])# we're done here
153-
finally:
154-
ifeggandos.path.exists(egg):
155-
os.unlink(egg)
156-
else:
157-
ifsetuptools.__version__=='0.0.1':
158-
# tell the user to uninstall obsolete version
159-
use_setuptools(version)
160-
161-
req="setuptools>="+version
162-
importpkg_resources
163-
try:
164-
pkg_resources.require(req)
165-
exceptpkg_resources.VersionConflict:
166-
try:
167-
fromsetuptools.command.easy_installimportmain
168-
exceptImportError:
169-
fromeasy_installimportmain
170-
main(list(argv)+[download_setuptools(delay=0)])
171-
sys.exit(0)# try to force an exit
172-
else:
173-
ifargv:
174-
fromsetuptools.command.easy_installimportmain
175-
main(argv)
176-
else:
177-
print"Setuptools version",version,"or greater has been installed."
178-
print'(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
142+
"""Install or upgrade setuptools and EasyInstall"""
143+
144+
try:
145+
importsetuptools
146+
exceptImportError:
147+
egg=None
148+
try:
149+
egg=download_setuptools(version,delay=0)
150+
sys.path.insert(0,egg)
151+
fromsetuptools.command.easy_installimportmain
152+
returnmain(list(argv)+[egg])# we're done here
153+
finally:
154+
ifeggandos.path.exists(egg):
155+
os.unlink(egg)
156+
else:
157+
ifsetuptools.__version__=='0.0.1':
158+
# tell the user to uninstall obsolete version
159+
use_setuptools(version)
160+
161+
req="setuptools>="+version
162+
importpkg_resources
163+
try:
164+
pkg_resources.require(req)
165+
exceptpkg_resources.VersionConflict:
166+
try:
167+
fromsetuptools.command.easy_installimportmain
168+
exceptImportError:
169+
fromeasy_installimportmain
170+
main(list(argv)+[download_setuptools(delay=0)])
171+
sys.exit(0)# try to force an exit
172+
else:
173+
ifargv:
174+
fromsetuptools.command.easy_installimportmain
175+
main(argv)
176+
else:
177+
print"Setuptools version",version,"or greater has been installed."
178+
print'(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
179179

180180

181181

182182
defupdate_md5(filenames):
183-
"""Update our built-in md5 registry"""
183+
"""Update our built-in md5 registry"""
184184

185-
importre
186-
frommd5importmd5
185+
importre
186+
frommd5importmd5
187187

188-
fornameinfilenames:
189-
base=os.path.basename(name)
190-
f=open(name,'rb')
191-
md5_data[base]=md5(f.read()).hexdigest()
192-
f.close()
188+
fornameinfilenames:
189+
base=os.path.basename(name)
190+
f=open(name,'rb')
191+
md5_data[base]=md5(f.read()).hexdigest()
192+
f.close()
193193

194-
data= [" %r: %r,\n"%itforitinmd5_data.items()]
195-
data.sort()
196-
repl="".join(data)
194+
data= [" %r: %r,\n"%itforitinmd5_data.items()]
195+
data.sort()
196+
repl="".join(data)
197197

198-
importinspect
199-
srcfile=inspect.getsourcefile(sys.modules[__name__])
200-
f=open(srcfile,'rb');src=f.read();f.close()
198+
importinspect
199+
srcfile=inspect.getsourcefile(sys.modules[__name__])
200+
f=open(srcfile,'rb');src=f.read();f.close()
201201

202-
match=re.search("\nmd5_data = {\n([^}]+)}",src)
203-
ifnotmatch:
204-
print>>sys.stderr,"Internal error!"
205-
sys.exit(2)
202+
match=re.search("\nmd5_data = {\n([^}]+)}",src)
203+
ifnotmatch:
204+
print>>sys.stderr,"Internal error!"
205+
sys.exit(2)
206206

207-
src=src[:match.start(1)]+repl+src[match.end(1):]
208-
f=open(srcfile,'w')
209-
f.write(src)
210-
f.close()
207+
src=src[:match.start(1)]+repl+src[match.end(1):]
208+
f=open(srcfile,'w')
209+
f.write(src)
210+
f.close()
211211

212212

213213
if__name__=='__main__':
214-
iflen(sys.argv)>2andsys.argv[1]=='--md5update':
215-
update_md5(sys.argv[2:])
216-
else:
217-
main(sys.argv[1:])
214+
iflen(sys.argv)>2andsys.argv[1]=='--md5update':
215+
update_md5(sys.argv[2:])
216+
else:
217+
main(sys.argv[1:])
218218

219219

220220

‎lib/git/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
fromgit.utilsimportLockFile,BlockingLockFile
2424

2525
__all__= [nameforname,objinlocals().items()
26-
ifnot (name.startswith('_')orinspect.ismodule(obj)) ]
26+
ifnot (name.startswith('_')orinspect.ismodule(obj)) ]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp