Commit 45ae6fb6 authored by tarek's avatar tarek

cleaning a bit ez_setup.py while reading it

--HG--
branch : distribute
extra : rebase_source : b6243971cad89290dc4e3856e9f3c98aa1949d6c
parent 59e0da98
......@@ -14,6 +14,12 @@ the appropriate options to ``use_setuptools()``.
This file can also be run as a script to install or upgrade setuptools.
"""
import sys
import sys, os
try:
from hashlib import md5
except ImportError:
from md5 import md5
DEFAULT_VERSION = "0.6"
DEFAULT_URL = "http://pypi.python.org/packages/%s/d/distribute/" % sys.version[:3]
......@@ -24,10 +30,6 @@ md5_data = {
'distribute-0.6-py2.6.egg': '',
}
import sys, os
try: from hashlib import md5
except ImportError: from md5 import md5
def _validate_md5(egg_name, data):
if egg_name in md5_data:
digest = md5(data).hexdigest()
......@@ -62,7 +64,7 @@ def use_setuptools(
try:
import pkg_resources
except ImportError:
return do_download()
return do_download()
try:
pkg_resources.require("distribute>="+version); return
except pkg_resources.VersionConflict, e:
......@@ -127,41 +129,6 @@ and place it in this directory before rerunning this script.)
if dst: dst.close()
return os.path.realpath(saveto)
def main(argv, version=DEFAULT_VERSION):
"""Install or upgrade setuptools and EasyInstall"""
try:
......@@ -233,14 +200,9 @@ def update_md5(filenames):
f.close()
if __name__=='__main__':
if len(sys.argv)>2 and sys.argv[1]=='--md5update':
if __name__ == '__main__':
if len(sys.argv) > 2 and sys.argv[1] == '--md5update':
update_md5(sys.argv[2:])
else:
main(sys.argv[1:])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment