Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: third_party/protobuf/python/ez_setup.py

Issue 1291903002: Pull new version of protobuf sources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!python 1 #!python
2 2
3 # This file was obtained from: 3 # This file was obtained from:
4 # http://peak.telecommunity.com/dist/ez_setup.py 4 # http://peak.telecommunity.com/dist/ez_setup.py
5 # on 2011/1/21. 5 # on 2011/1/21.
6 6
7 """Bootstrap setuptools installation 7 """Bootstrap setuptools installation
8 8
9 If you want to use setuptools in your package's setup.py, just include this 9 If you want to use setuptools in your package's setup.py, just include this
10 file in the same directory with it, and add this to the top of your setup.py:: 10 file in the same directory with it, and add this to the top of your setup.py::
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules 100 was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules
101 def do_download(): 101 def do_download():
102 egg = download_setuptools(version, download_base, to_dir, download_delay ) 102 egg = download_setuptools(version, download_base, to_dir, download_delay )
103 sys.path.insert(0, egg) 103 sys.path.insert(0, egg)
104 import setuptools; setuptools.bootstrap_install_from = egg 104 import setuptools; setuptools.bootstrap_install_from = egg
105 try: 105 try:
106 import pkg_resources 106 import pkg_resources
107 except ImportError: 107 except ImportError:
108 return do_download() 108 return do_download()
109 try: 109 try:
110 return do_download()
110 pkg_resources.require("setuptools>="+version); return 111 pkg_resources.require("setuptools>="+version); return
111 except pkg_resources.VersionConflict, e: 112 except pkg_resources.VersionConflict, e:
112 if was_imported: 113 if was_imported:
113 print >>sys.stderr, ( 114 print >>sys.stderr, (
114 "The required version of setuptools (>=%s) is not available, and\n" 115 "The required version of setuptools (>=%s) is not available, and\n"
115 "can't be installed while this script is running. Please install\n" 116 "can't be installed while this script is running. Please install\n"
116 " a more recent version first, using 'easy_install -U setuptools'." 117 " a more recent version first, using 'easy_install -U setuptools'."
117 "\n\n(Currently using %r)" 118 "\n\n(Currently using %r)"
118 ) % (version, e.args[0]) 119 ) % (version, e.args[0])
119 sys.exit(2) 120 sys.exit(2)
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 f = open(srcfile,'w') 275 f = open(srcfile,'w')
275 f.write(src) 276 f.write(src)
276 f.close() 277 f.close()
277 278
278 279
279 if __name__=='__main__': 280 if __name__=='__main__':
280 if len(sys.argv)>2 and sys.argv[1]=='--md5update': 281 if len(sys.argv)>2 and sys.argv[1]=='--md5update':
281 update_md5(sys.argv[2:]) 282 update_md5(sys.argv[2:])
282 else: 283 else:
283 main(sys.argv[1:]) 284 main(sys.argv[1:])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698