Whilespace normalization (reindint.py).

This commit is contained in:
Tim Peters 2006-04-18 17:32:12 +00:00
parent 17a35f906c
commit 584b0e0c3d
31 changed files with 53 additions and 314 deletions

View File

@ -3,4 +3,3 @@
if __name__ == '__main__': if __name__ == '__main__':
from setuptools.command.easy_install import main from setuptools.command.easy_install import main
main() main()

View File

@ -58,7 +58,7 @@ def get_supported_platform():
# Exceptions # Exceptions
'ResolutionError','VersionConflict','DistributionNotFound','UnknownExtra', 'ResolutionError','VersionConflict','DistributionNotFound','UnknownExtra',
'ExtractionError', 'ExtractionError',
# Parsing functions and string utilities # Parsing functions and string utilities
'parse_requirements', 'parse_version', 'safe_name', 'safe_version', 'parse_requirements', 'parse_version', 'safe_name', 'safe_version',
'get_platform', 'compatible_platforms', 'yield_lines', 'split_sections', 'get_platform', 'compatible_platforms', 'yield_lines', 'split_sections',
@ -823,7 +823,7 @@ def extraction_error(self):
old_exc = sys.exc_info()[1] old_exc = sys.exc_info()[1]
cache_path = self.extraction_path or get_default_cache() cache_path = self.extraction_path or get_default_cache()
err = ExtractionError("""Can't extract file(s) to egg cache err = ExtractionError("""Can't extract file(s) to egg cache
The following error occurred while trying to extract file(s) to the Python egg The following error occurred while trying to extract file(s) to the Python egg
@ -878,7 +878,7 @@ def get_cache_path(self, archive_name, names=()):
ensure_directory(target_path) ensure_directory(target_path)
except: except:
self.extraction_error() self.extraction_error()
self.cached_files[target_path] = 1 self.cached_files[target_path] = 1
return target_path return target_path
@ -1264,11 +1264,11 @@ def _extract_resource(self, manager, zip_path):
try: try:
rename(tmpnam, real_path) rename(tmpnam, real_path)
except os.error: except os.error:
if os.path.isfile(real_path): if os.path.isfile(real_path):
stat = os.stat(real_path) stat = os.stat(real_path)
if stat.st_size==size and stat.st_mtime==timestamp: if stat.st_size==size and stat.st_mtime==timestamp:
# size and stamp match, somebody did it just ahead of # size and stamp match, somebody did it just ahead of
# us, so we're done # us, so we're done
@ -2375,4 +2375,3 @@ def _initialize(g):
# calling ``require()``) will get activated as well. # calling ``require()``) will get activated as well.
add_activation_listener(lambda dist: dist.activate()) add_activation_listener(lambda dist: dist.activate())
working_set.entries=[]; map(working_set.add_entry,sys.path) # match order working_set.entries=[]; map(working_set.add_entry,sys.path) # match order

View File

@ -44,7 +44,7 @@ def wrapper(*args,**kw):
class cls(cls,object): pass class cls(cls,object): pass
mro = cls.__mro__[1:] mro = cls.__mro__[1:]
except TypeError: except TypeError:
mro = object, # must be an ExtensionClass or some such :( mro = object, # must be an ExtensionClass or some such :(
for t in mro: for t in mro:
if t in registry: if t in registry:
return registry[t](*args,**kw) return registry[t](*args,**kw)
@ -64,7 +64,7 @@ def register(typ, func=None):
wrapper.__dict__ = func.__dict__ wrapper.__dict__ = func.__dict__
wrapper.__doc__ = func.__doc__ wrapper.__doc__ = func.__doc__
wrapper.register = register wrapper.register = register
return wrapper return wrapper
def walk_packages(path=None, prefix='', onerror=None): def walk_packages(path=None, prefix='', onerror=None):
@ -160,7 +160,7 @@ def iter_modules(self, prefix=''):
modname = inspect.getmodulename(fn) modname = inspect.getmodulename(fn)
if modname=='__init__' or modname in yielded: if modname=='__init__' or modname in yielded:
continue continue
path = os.path.join(self.path, fn) path = os.path.join(self.path, fn)
ispkg = False ispkg = False
@ -276,7 +276,7 @@ def get_filename(self, fullname=None):
try: try:
import zipimport import zipimport
from zipimport import zipimporter from zipimport import zipimporter
def iter_zipimport_modules(importer, prefix=''): def iter_zipimport_modules(importer, prefix=''):
dirlist = zipimport._zip_directory_cache[importer.archive].keys() dirlist = zipimport._zip_directory_cache[importer.archive].keys()
dirlist.sort() dirlist.sort()

View File

@ -40,7 +40,7 @@ def find_packages(where='.', exclude=()):
return out return out
setup = distutils.core.setup setup = distutils.core.setup
_Command = _get_unpatched(_Command) _Command = _get_unpatched(_Command)
class Command(_Command): class Command(_Command):
@ -53,7 +53,7 @@ def __init__(self, dist, **kw):
_Command.__init__(self,dist) _Command.__init__(self,dist)
for k,v in kw.items(): for k,v in kw.items():
setattr(self,k,v) setattr(self,k,v)
def reinitialize_command(self, command, reinit_subcommands=0, **kw): def reinitialize_command(self, command, reinit_subcommands=0, **kw):
cmd = _Command.reinitialize_command(self, command, reinit_subcommands) cmd = _Command.reinitialize_command(self, command, reinit_subcommands)
for k,v in kw.items(): for k,v in kw.items():
@ -62,21 +62,3 @@ def reinitialize_command(self, command, reinit_subcommands=0, **kw):
import distutils.core import distutils.core
distutils.core.Command = Command # we can't patch distutils.cmd, alas distutils.core.Command = Command # we can't patch distutils.cmd, alas

View File

@ -14,7 +14,7 @@ class UnrecognizedFormat(DistutilsError):
"""Couldn't recognize the archive type""" """Couldn't recognize the archive type"""
def default_filter(src,dst): def default_filter(src,dst):
"""The default progress/filter callback; returns True for all files""" """The default progress/filter callback; returns True for all files"""
return dst return dst
@ -184,7 +184,7 @@ def unpack_tarfile(filename, extract_dir, progress_filter=default_filter):
name = member.name name = member.name
# don't extract absolute paths or ones with .. in them # don't extract absolute paths or ones with .. in them
if not name.startswith('/') and '..' not in name: if not name.startswith('/') and '..' not in name:
dst = os.path.join(extract_dir, *name.split('/')) dst = os.path.join(extract_dir, *name.split('/'))
dst = progress_filter(name, dst) dst = progress_filter(name, dst)
if dst: if dst:
if dst.endswith(os.sep): if dst.endswith(os.sep):
@ -198,8 +198,3 @@ def unpack_tarfile(filename, extract_dir, progress_filter=default_filter):
extraction_drivers = unpack_directory, unpack_zipfile, unpack_tarfile extraction_drivers = unpack_directory, unpack_zipfile, unpack_tarfile

View File

@ -8,7 +8,7 @@
if sys.version>='2.5': if sys.version>='2.5':
# In Python 2.5 and above, distutils includes its own upload command # In Python 2.5 and above, distutils includes its own upload command
__all__.remove('upload') __all__.remove('upload')
from distutils.command.bdist import bdist from distutils.command.bdist import bdist

View File

@ -11,17 +11,17 @@ def shquote(arg):
if c in arg: return repr(arg) if c in arg: return repr(arg)
if arg.split()<>[arg]: if arg.split()<>[arg]:
return repr(arg) return repr(arg)
return arg return arg
class alias(option_base): class alias(option_base):
"""Define a shortcut that invokes one or more commands""" """Define a shortcut that invokes one or more commands"""
description = "define a shortcut to invoke one or more commands" description = "define a shortcut to invoke one or more commands"
command_consumes_arguments = True command_consumes_arguments = True
user_options = [ user_options = [
('remove', 'r', 'remove (unset) the alias'), ('remove', 'r', 'remove (unset) the alias'),
] + option_base.user_options ] + option_base.user_options
boolean_options = option_base.boolean_options + ['remove'] boolean_options = option_base.boolean_options + ['remove']
@ -77,6 +77,3 @@ def format_alias(name, aliases):
else: else:
source = '--filename=%r' % source source = '--filename=%r' % source
return source+name+' '+command return source+name+' '+command

View File

@ -233,7 +233,7 @@ def run(self):
if self.exclude_source_files: if self.exclude_source_files:
self.zap_pyfiles() self.zap_pyfiles()
# Make the archive # Make the archive
make_zipfile(self.egg_output, archive_root, verbose=self.verbose, make_zipfile(self.egg_output, archive_root, verbose=self.verbose,
dry_run=self.dry_run) dry_run=self.dry_run)
@ -262,7 +262,7 @@ def zip_safe(self):
def make_init_files(self): def make_init_files(self):
"""Create missing package __init__ files""" """Create missing package __init__ files"""
init_files = [] init_files = []
for base,dirs,files in walk_egg(self.bdist_dir): for base,dirs,files in walk_egg(self.bdist_dir):
if base==self.bdist_dir: if base==self.bdist_dir:
# don't put an __init__ in the root # don't put an __init__ in the root
@ -276,7 +276,7 @@ def make_init_files(self):
filename = os.path.join(base,'__init__.py') filename = os.path.join(base,'__init__.py')
if not self.dry_run: if not self.dry_run:
f = open(filename,'w'); f.write(NS_PKG_STUB) f = open(filename,'w'); f.write(NS_PKG_STUB)
f.close() f.close()
init_files.append(filename) init_files.append(filename)
break break
else: else:
@ -329,7 +329,7 @@ def get_ext_outputs(self):
def walk_egg(egg_dir): def walk_egg(egg_dir):
"""Walk an unpacked egg's contents, skipping the metadata directory""" """Walk an unpacked egg's contents, skipping the metadata directory"""
walker = os.walk(egg_dir) walker = os.walk(egg_dir)
base,dirs,files = walker.next() base,dirs,files = walker.next()
if 'EGG-INFO' in dirs: if 'EGG-INFO' in dirs:
dirs.remove('EGG-INFO') dirs.remove('EGG-INFO')
yield base,dirs,files yield base,dirs,files
@ -447,5 +447,3 @@ def visit (z, dirname, names):
os.path.walk(base_dir, visit, None) os.path.walk(base_dir, visit, None)
return zip_filename return zip_filename

View File

@ -35,34 +35,3 @@ def _make_spec_file(self):
] ]
spec.insert(spec.index(line24)+1, "%define unmangled_version "+version) spec.insert(spec.index(line24)+1, "%define unmangled_version "+version)
return spec return spec

View File

@ -283,5 +283,3 @@ def link_shared_object(self, objects, output_libname, output_dir=None,
self.create_static_lib( self.create_static_lib(
objects, basename, output_dir, debug, target_lang objects, basename, output_dir, debug, target_lang
) )

View File

@ -93,7 +93,7 @@ def analyze_manifest(self):
ei_cmd = self.get_finalized_command('egg_info') ei_cmd = self.get_finalized_command('egg_info')
for path in ei_cmd.filelist.files: for path in ei_cmd.filelist.files:
if path.endswith('.py'): if path.endswith('.py'):
continue continue
d,f = os.path.split(assert_relative(path)) d,f = os.path.split(assert_relative(path))
prev = None prev = None
while d and d!=prev and d not in src_dirs: while d and d!=prev and d not in src_dirs:
@ -142,7 +142,7 @@ def check_package(self, package, package_dir):
f = open(init_py,'rU') f = open(init_py,'rU')
if 'declare_namespace' not in f.read(): if 'declare_namespace' not in f.read():
from distutils.errors import DistutilsError from distutils.errors import DistutilsError
raise DistutilsError( raise DistutilsError(
"Namespace package problem: %s is a namespace package, but its\n" "Namespace package problem: %s is a namespace package, but its\n"
"__init__.py does not call declare_namespace()! Please fix it.\n" "__init__.py does not call declare_namespace()! Please fix it.\n"
@ -167,7 +167,7 @@ def exclude_data_files(self, package, src_dir, files):
globs = (self.exclude_package_data.get('', []) globs = (self.exclude_package_data.get('', [])
+ self.exclude_package_data.get(package, [])) + self.exclude_package_data.get(package, []))
bad = [] bad = []
for pattern in globs: for pattern in globs:
bad.extend( bad.extend(
fnmatch.filter( fnmatch.filter(
files, os.path.join(src_dir, convert_path(pattern)) files, os.path.join(src_dir, convert_path(pattern))
@ -190,16 +190,3 @@ def assert_relative(path):
setup.py directory, *never* absolute paths. setup.py directory, *never* absolute paths.
""" % path """ % path
) )

View File

@ -46,7 +46,7 @@ def finalize_options(self):
"Please rename %r to %r before using 'develop'" "Please rename %r to %r before using 'develop'"
% (ei.egg_info, ei.broken_egg_info) % (ei.egg_info, ei.broken_egg_info)
) )
self.args = [ei.egg_name] self.args = [ei.egg_name]
easy_install.finalize_options(self) easy_install.finalize_options(self)
self.egg_link = os.path.join(self.install_dir, ei.egg_name+'.egg-link') self.egg_link = os.path.join(self.install_dir, ei.egg_name+'.egg-link')
self.egg_base = ei.egg_base self.egg_base = ei.egg_base
@ -104,7 +104,7 @@ def install_egg_scripts(self, dist):
# create wrapper scripts in the script dir, pointing to dist.scripts # create wrapper scripts in the script dir, pointing to dist.scripts
# new-style... # new-style...
self.install_wrapper_scripts(dist) self.install_wrapper_scripts(dist)
# ...and old-style # ...and old-style
for script_name in self.distribution.scripts or []: for script_name in self.distribution.scripts or []:
@ -114,10 +114,3 @@ def install_egg_scripts(self, dist):
script_text = f.read() script_text = f.read()
f.close() f.close()
self.install_script(dist, script_name, script_text, script_path) self.install_script(dist, script_name, script_text, script_path)

View File

@ -1357,7 +1357,7 @@ def save(self):
"""Write changed .pth file back to disk""" """Write changed .pth file back to disk"""
if not self.dirty: if not self.dirty:
return return
data = '\n'.join(map(self.make_relative,self.paths)) data = '\n'.join(map(self.make_relative,self.paths))
if data: if data:
log.debug("Saving %s", self.filename) log.debug("Saving %s", self.filename)
@ -1434,7 +1434,7 @@ def uncache_zipdir(path):
del zdc[p] del zdc[p]
return return
def get_script_args(dist, executable=sys_executable): def get_script_args(dist, executable=sys_executable):
"""Yield write_script() argument tuples for a distribution's entrypoints""" """Yield write_script() argument tuples for a distribution's entrypoints"""
spec = str(dist.as_requirement()) spec = str(dist.as_requirement())
@ -1553,8 +1553,3 @@ def _show_help(self,*args,**kw):
distclass=DistributionWithoutHelpCommands, **kw distclass=DistributionWithoutHelpCommands, **kw
) )
) )

View File

@ -363,7 +363,3 @@ def get_pkg_info_revision():
if match: if match:
return int(match.group(1)) return int(match.group(1))
return 0 return 0

View File

@ -60,7 +60,7 @@ def run(self):
caller = sys._getframe(2) caller = sys._getframe(2)
caller_module = caller.f_globals.get('__name__','') caller_module = caller.f_globals.get('__name__','')
caller_name = caller.f_code.co_name caller_name = caller.f_code.co_name
if caller_module != 'distutils.dist' or caller_name!='run_commands': if caller_module != 'distutils.dist' or caller_name!='run_commands':
# We weren't called from the command line or setup(), so we # We weren't called from the command line or setup(), so we
# should run in backward-compatibility mode to support bdist_* # should run in backward-compatibility mode to support bdist_*
@ -68,7 +68,7 @@ def run(self):
_install.run(self) _install.run(self)
else: else:
self.do_egg_install() self.do_egg_install()
@ -99,25 +99,3 @@ def do_egg_install(self):
cmd.args = args cmd.args = args
cmd.run() cmd.run()
setuptools.bootstrap_install_from = None setuptools.bootstrap_install_from = None

View File

@ -22,7 +22,7 @@ def finalize_options(self):
None, None, ei_cmd.egg_name, ei_cmd.egg_version None, None, ei_cmd.egg_name, ei_cmd.egg_version
).egg_name()+'.egg-info' ).egg_name()+'.egg-info'
self.source = ei_cmd.egg_info self.source = ei_cmd.egg_info
self.target = os.path.join(self.install_dir, basename) self.target = os.path.join(self.install_dir, basename)
self.outputs = [self.target] self.outputs = [self.target]
def run(self): def run(self):
@ -43,7 +43,7 @@ def get_outputs(self):
return self.outputs return self.outputs
def copytree(self): def copytree(self):
# Copy the .egg-info tree to site-packages # Copy the .egg-info tree to site-packages
def skimmer(src,dst): def skimmer(src,dst):
# filter out source-control directories; note that 'src' is always # filter out source-control directories; note that 'src' is always
# a '/'-separated path, regardless of platform. 'dst' is a # a '/'-separated path, regardless of platform. 'dst' is a
@ -78,5 +78,4 @@ def install_namespaces(self):
"(p not in mp) and mp.append(p)\n" "(p not in mp) and mp.append(p)\n"
% locals() % locals()
) )
f.close() f.close()

View File

@ -74,9 +74,3 @@ def get_outputs(self):
if exclude: if exclude:
return [f for f in outputs if f not in exclude] return [f for f in outputs if f not in exclude]
return outputs return outputs

View File

@ -11,7 +11,7 @@ class install_scripts(_install_scripts):
def initialize_options(self): def initialize_options(self):
_install_scripts.initialize_options(self) _install_scripts.initialize_options(self)
self.no_ep = False self.no_ep = False
def run(self): def run(self):
self.run_command("egg_info") self.run_command("egg_info")
if self.distribution.scripts: if self.distribution.scripts:
@ -20,9 +20,9 @@ def run(self):
self.outfiles = [] self.outfiles = []
if self.no_ep: if self.no_ep:
# don't install entry point scripts into .egg file! # don't install entry point scripts into .egg file!
return return
ei_cmd = self.get_finalized_command("egg_info") ei_cmd = self.get_finalized_command("egg_info")
dist = Distribution( dist = Distribution(
ei_cmd.egg_base, PathMetadata(ei_cmd.egg_base, ei_cmd.egg_info), ei_cmd.egg_base, PathMetadata(ei_cmd.egg_base, ei_cmd.egg_info),
ei_cmd.egg_name, ei_cmd.egg_version, ei_cmd.egg_name, ei_cmd.egg_version,
@ -54,29 +54,3 @@ def write_script(self, script_name, contents, mode="t", *ignored):
os.chmod(target,0755) os.chmod(target,0755)
except (AttributeError, os.error): except (AttributeError, os.error):
pass pass

View File

@ -28,7 +28,7 @@ def finalize_options(self):
"(e.g. '.zip' or '.egg')" "(e.g. '.zip' or '.egg')"
) )
if self.keep is None: if self.keep is None:
raise DistutilsOptionError("Must specify number of files to keep") raise DistutilsOptionError("Must specify number of files to keep")
try: try:
self.keep = int(self.keep) self.keep = int(self.keep)
except ValueError: except ValueError:
@ -55,28 +55,3 @@ def run(self):
log.info("Deleting %s", f) log.info("Deleting %s", f)
if not self.dry_run: if not self.dry_run:
os.unlink(f) os.unlink(f)

View File

@ -22,4 +22,3 @@ def run(self):
settings.setdefault(cmd,{})[opt] = val settings.setdefault(cmd,{})[opt] = val
edit_config(self.filename, settings, self.dry_run) edit_config(self.filename, settings, self.dry_run)

View File

@ -144,7 +144,7 @@ def run(self):
self.filelist.append(os.path.join(ei_cmd.egg_info,'SOURCES.txt')) self.filelist.append(os.path.join(ei_cmd.egg_info,'SOURCES.txt'))
self.check_metadata() self.check_metadata()
self.make_distribution() self.make_distribution()
dist_files = getattr(self.distribution,'dist_files',[]) dist_files = getattr(self.distribution,'dist_files',[])
for file in self.archive_files: for file in self.archive_files:
@ -161,4 +161,3 @@ def read_template(self):
# dying and thus masking the real error # dying and thus masking the real error
sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close() sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close()
raise raise

View File

@ -82,7 +82,7 @@ def edit_config(filename, settings, dry_run=False):
class option_base(Command): class option_base(Command):
"""Abstract base class for commands that mess with config files""" """Abstract base class for commands that mess with config files"""
user_options = [ user_options = [
('global-config', 'g', ('global-config', 'g',
"save options to the site-wide distutils.cfg file"), "save options to the site-wide distutils.cfg file"),
@ -94,7 +94,7 @@ class option_base(Command):
boolean_options = [ boolean_options = [
'global-config', 'user-config', 'global-config', 'user-config',
] ]
def initialize_options(self): def initialize_options(self):
self.global_config = None self.global_config = None
@ -116,7 +116,7 @@ def finalize_options(self):
"Must specify only one configuration file option", "Must specify only one configuration file option",
filenames filenames
) )
self.filename, = filenames self.filename, = filenames
@ -130,7 +130,7 @@ class setopt(option_base):
('command=', 'c', 'command to set an option for'), ('command=', 'c', 'command to set an option for'),
('option=', 'o', 'option to set'), ('option=', 'o', 'option to set'),
('set-value=', 's', 'value of the option'), ('set-value=', 's', 'value of the option'),
('remove', 'r', 'remove (unset) the value'), ('remove', 'r', 'remove (unset) the value'),
] + option_base.user_options ] + option_base.user_options
boolean_options = option_base.boolean_options + ['remove'] boolean_options = option_base.boolean_options + ['remove']
@ -156,9 +156,3 @@ def run(self):
}, },
self.dry_run self.dry_run
) )

View File

@ -88,7 +88,7 @@ def run(self):
self.reinitialize_command('build_ext', inplace=1) self.reinitialize_command('build_ext', inplace=1)
self.run_command('build_ext') self.run_command('build_ext')
if self.distribution.tests_require: if self.distribution.tests_require:
self.distribution.fetch_build_eggs(self.distribution.tests_require) self.distribution.fetch_build_eggs(self.distribution.tests_require)
if self.test_suite: if self.test_suite:
@ -117,7 +117,3 @@ def run_tests(self):
None, None, [unittest.__file__]+self.test_args, None, None, [unittest.__file__]+self.test_args,
testLoader = loader_class() testLoader = loader_class()
) )

View File

@ -237,10 +237,3 @@ def extract_constant(code,symbol,default=-1):
return const return const
else: else:
const = default const = default

View File

@ -796,25 +796,3 @@ def validate(self,dist):
" doesn't contain any packages or modules under %s" " doesn't contain any packages or modules under %s"
% (self.description, item, item) % (self.description, item, item)
) )

View File

@ -14,7 +14,7 @@ class Extension(_Extension):
"""Extension that uses '.c' files in place of '.pyx' files""" """Extension that uses '.c' files in place of '.pyx' files"""
if not have_pyrex: if not have_pyrex:
# convert .pyx extensions to .c # convert .pyx extensions to .c
def __init__(self,*args,**kw): def __init__(self,*args,**kw):
_Extension.__init__(self,*args,**kw) _Extension.__init__(self,*args,**kw)
sources = [] sources = []
@ -33,4 +33,3 @@ class Library(Extension):
distutils.extension.Extension = Extension distutils.extension.Extension = Extension
if 'distutils.command.build_ext' in sys.modules: if 'distutils.command.build_ext' in sys.modules:
sys.modules['distutils.command.build_ext'].Extension = Extension sys.modules['distutils.command.build_ext'].Extension = Extension

View File

@ -260,7 +260,7 @@ def scan_all(self, msg=None, *args):
def find_packages(self, requirement): def find_packages(self, requirement):
self.scan_url(self.index_url + requirement.unsafe_name+'/') self.scan_url(self.index_url + requirement.unsafe_name+'/')
if not self.package_pages.get(requirement.key): if not self.package_pages.get(requirement.key):
# Fall back to safe version of the name # Fall back to safe version of the name
self.scan_url(self.index_url + requirement.project_name+'/') self.scan_url(self.index_url + requirement.project_name+'/')
@ -489,7 +489,7 @@ def gen_setup(self, filename, fragment, tmpdir):
"Can't process plain .py files without an '#egg=name-version'" "Can't process plain .py files without an '#egg=name-version'"
" suffix to enable automatic setup script generation." " suffix to enable automatic setup script generation."
) )
dl_blocksize = 8192 dl_blocksize = 8192
def _download_to(self, url, filename): def _download_to(self, url, filename):
self.url_ok(url,True) # raises error if not allowed self.url_ok(url,True) # raises error if not allowed
@ -672,26 +672,3 @@ def get_sf_ip():
# DNS-bl0ck1n9 f1r3w4llz sUx0rs! # DNS-bl0ck1n9 f1r3w4llz sUx0rs!
_sf_mirrors[:] = ['dl.sourceforge.net'] _sf_mirrors[:] = ['dl.sourceforge.net']
return random.choice(_sf_mirrors) return random.choice(_sf_mirrors)

View File

@ -201,5 +201,3 @@ def __str__(self):
support alternate installation locations even if you run its setup support alternate installation locations even if you run its setup
script by hand. Please inform the package's author and the EasyInstall script by hand. Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.""" % self.args maintainers to find out if a fix or workaround is available.""" % self.args

View File

@ -1,5 +1,5 @@
def __boot(): def __boot():
import sys, imp, os, os.path import sys, imp, os, os.path
PYTHONPATH = os.environ.get('PYTHONPATH') PYTHONPATH = os.environ.get('PYTHONPATH')
if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH): if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH):
PYTHONPATH = [] PYTHONPATH = []
@ -48,7 +48,7 @@ def __boot():
addsitedir(item) addsitedir(item)
sys.__egginsert += oldpos # restore effective old position sys.__egginsert += oldpos # restore effective old position
d,nd = makepath(stdpath[0]) d,nd = makepath(stdpath[0])
insert_at = None insert_at = None
new_path = [] new_path = []
@ -66,17 +66,9 @@ def __boot():
# new path after the insert point, back-insert it # new path after the insert point, back-insert it
new_path.insert(insert_at, item) new_path.insert(insert_at, item)
insert_at += 1 insert_at += 1
sys.path[:] = new_path sys.path[:] = new_path
if __name__=='site': if __name__=='site':
__boot() __boot()
del __boot del __boot

View File

@ -362,8 +362,3 @@ def testNoSuite(self):
ts5 = makeSetup().get_command_obj('test') ts5 = makeSetup().get_command_obj('test')
ts5.ensure_finalized() ts5.ensure_finalized()
self.assertEqual(ts5.test_suite, None) self.assertEqual(ts5.test_suite, None)

View File

@ -143,7 +143,7 @@ def testResolve(self):
self.assertRaises(VersionConflict, ws.resolve, self.assertRaises(VersionConflict, ws.resolve,
parse_requirements("Foo==0.9"), ad) parse_requirements("Foo==0.9"), ad)
ws = WorkingSet([]) # reset ws = WorkingSet([]) # reset
# Request an extra that causes an unresolved dependency for "Baz" # Request an extra that causes an unresolved dependency for "Baz"
self.assertRaises( self.assertRaises(
DistributionNotFound, ws.resolve,parse_requirements("Foo[bar]"), ad DistributionNotFound, ws.resolve,parse_requirements("Foo[bar]"), ad
@ -161,7 +161,7 @@ def testResolve(self):
self.assertRaises( VersionConflict, self.assertRaises( VersionConflict,
ws.resolve, parse_requirements("Foo==1.2\nFoo!=1.2"), ad ws.resolve, parse_requirements("Foo==1.2\nFoo!=1.2"), ad
) )
def testDistroDependsOptions(self): def testDistroDependsOptions(self):
d = self.distRequires(""" d = self.distRequires("""
Twisted>=1.5 Twisted>=1.5
@ -481,12 +481,3 @@ def c(s1,s2):
for p,v1 in enumerate(torture): for p,v1 in enumerate(torture):
for v2 in torture[p+1:]: for v2 in torture[p+1:]:
c(v2,v1) c(v2,v1)