Merged revisions 76956 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r76956 | tarek.ziade | 2009-12-21 02:22:46 +0100 (Mon, 21 Dec 2009) | 1 line

  massive import cleaning in Distutils
........
This commit is contained in:
Tarek Ziadé 2009-12-21 01:49:00 +00:00
parent 8b9361a26d
commit 88e2c5d35a
24 changed files with 62 additions and 78 deletions

View File

@ -13,13 +13,11 @@ for the Borland C++ compiler.
__revision__ = "$Id$"
import os
from distutils.errors import \
DistutilsExecError, DistutilsPlatformError, \
CompileError, LibError, LinkError, UnknownFileError
from distutils.ccompiler import \
CCompiler, gen_preprocess_options, gen_lib_options
from distutils.errors import (DistutilsExecError, CompileError, LibError,
LinkError, UnknownFileError)
from distutils.ccompiler import CCompiler, gen_preprocess_options
from distutils.file_util import write_file
from distutils.dep_util import newer
from distutils import log

View File

@ -5,8 +5,11 @@ for the Distutils compiler abstraction model."""
__revision__ = "$Id$"
import sys, os, re
from distutils.errors import *
import sys
import os
import re
from distutils.errors import CompileError, LinkError, UnknownFileError
from distutils.spawn import spawn
from distutils.file_util import move_file
from distutils.dir_util import mkpath

View File

@ -6,8 +6,9 @@ distribution)."""
__revision__ = "$Id$"
import os
from distutils.core import Command
from distutils.errors import *
from distutils.errors import DistutilsPlatformError, DistutilsOptionError
from distutils.util import get_platform

View File

@ -28,7 +28,6 @@ class PyDialog(Dialog):
default, cancel, bitmap=true)"""
Dialog.__init__(self, *args)
ruler = self.h - 36
bmwidth = 152*ruler/328
#if kw.get("bitmap", True):
# self.bitmap("Bitmap", 0, 0, bmwidth, ruler, "PythonWin")
self.line("BottomLine", 0, ruler, self.w, 0)
@ -419,7 +418,6 @@ class bdist_msi(Command):
# see "Dialog Style Bits"
modal = 3 # visible | modal
modeless = 1 # visible
track_disk_space = 32
# UI customization properties
add_data(db, "Property",

View File

@ -5,13 +5,14 @@ distributions)."""
__revision__ = "$Id$"
import sys, os
import sys
import os
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.util import get_platform
from distutils.file_util import write_file
from distutils.errors import *
from distutils.sysconfig import get_python_version
from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
DistutilsFileError, DistutilsExecError)
from distutils import log
class bdist_rpm(Command):

View File

@ -5,11 +5,13 @@ exe-program."""
__revision__ = "$Id$"
import sys, os
import sys
import os
from distutils.core import Command
from distutils.util import get_platform
from distutils.dir_util import create_tree, remove_tree
from distutils.errors import *
from distutils.dir_util import remove_tree
from distutils.errors import DistutilsOptionError, DistutilsPlatformError
from distutils.sysconfig import get_python_version
from distutils import log

View File

@ -18,7 +18,7 @@ __revision__ = "$Id$"
import os
from distutils.core import Command
from distutils.errors import *
from distutils.errors import DistutilsSetupError
from distutils.sysconfig import customize_compiler
from distutils import log

View File

@ -10,7 +10,8 @@ import sys, os, re
from warnings import warn
from distutils.core import Command
from distutils.errors import *
from distutils.errors import (CCompilerError, DistutilsError, CompileError,
DistutilsSetupError, DistutilsPlatformError)
from distutils.sysconfig import customize_compiler, get_python_version
from distutils.dep_util import newer_group
from distutils.extension import Extension

View File

@ -133,7 +133,6 @@ class build_py(Command):
def build_package_data(self):
"""Copy data files into build directory"""
lastdir = None
for package, src_dir, build_dir, filenames in self.data_files:
for filename in filenames:
target = os.path.join(build_dir, filename)

View File

@ -11,7 +11,8 @@ this header file lives".
__revision__ = "$Id$"
import sys, os, re
import os
import re
from distutils.core import Command
from distutils.errors import DistutilsExecError

View File

@ -7,13 +7,15 @@ Implements the Distutils 'register' command (register with the repository).
__revision__ = "$Id$"
import os, string, getpass
import os
import string
import getpass
import io
import urllib.parse, urllib.request
import urllib.parse
import urllib.request
from warnings import warn
from distutils.core import PyPIRCCommand
from distutils.errors import *
from distutils import log
class register(PyPIRCCommand):

View File

@ -7,14 +7,14 @@ __revision__ = "$Id$"
import os
import string
import sys
from types import *
from glob import glob
from warnings import warn
from distutils.core import Command
from distutils import dir_util, dep_util, file_util, archive_util
from distutils.text_file import TextFile
from distutils.errors import *
from distutils.errors import (DistutilsPlatformError, DistutilsOptionError,
DistutilsTemplateError)
from distutils.filelist import FileList
from distutils import log
from distutils.util import convert_path

View File

@ -1,8 +1,8 @@
"""distutils.command.upload
Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
import sys
import os, io
import os
import io
import socket
import platform
from urllib.request import urlopen, Request, HTTPError
@ -10,7 +10,7 @@ from base64 import standard_b64encode
from urllib.parse import urlparse
from hashlib import md5
from distutils.errors import *
from distutils.errors import DistutilsOptionError
from distutils.core import PyPIRCCommand
from distutils.spawn import spawn
from distutils import log

View File

@ -4,7 +4,6 @@ Provides the PyPIRCCommand class, the base class for the command classes
that uses .pypirc in the distutils.command package.
"""
import os
import sys
from configparser import ConfigParser
from distutils.cmd import Command
@ -60,8 +59,6 @@ class PyPIRCCommand(Command):
if os.path.exists(rc):
self.announce('Using PyPI login from %s' % rc)
repository = self.repository or self.DEFAULT_REPOSITORY
realm = self.realm or self.DEFAULT_REALM
config = ConfigParser()
config.read(rc)
sections = config.sections()

View File

@ -8,10 +8,12 @@ really defined in distutils.dist and distutils.cmd.
__revision__ = "$Id$"
import sys, os
import sys
import os
from distutils.debug import DEBUG
from distutils.errors import *
from distutils.errors import (DistutilsSetupError, DistutilsArgError,
DistutilsError, CCompilerError)
from distutils.util import grok_environment_error
# Mainly import these so setup scripts can "from distutils.core import" them.
@ -31,7 +33,7 @@ usage: %(script)s [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: %(script)s cmd --help
"""
def gen_usage (script_name):
def gen_usage(script_name):
script = os.path.basename(script_name)
return USAGE % vars()
@ -56,7 +58,7 @@ extension_keywords = ('name', 'sources', 'include_dirs',
'extra_objects', 'extra_compile_args', 'extra_link_args',
'swig_opts', 'export_symbols', 'depends', 'language')
def setup (**attrs):
def setup(**attrs):
"""The gateway to the Distutils: do everything your setup script needs
to do, in a highly flexible and user-driven way. Briefly: create a
Distribution instance; find and parse config files; parse the command
@ -168,10 +170,8 @@ def setup (**attrs):
return dist
# setup ()
def run_setup (script_name, script_args=None, stop_after="run"):
def run_setup(script_name, script_args=None, stop_after="run"):
"""Run a setup script in a somewhat controlled environment, and
return the Distribution instance that drives things. This is useful
if you need to find out the distribution meta-data (passed as
@ -234,7 +234,4 @@ def run_setup (script_name, script_args=None, stop_after="run"):
# I wonder if the setup script's namespace -- g and l -- would be of
# any interest to callers?
#print "_setup_distribution:", _setup_distribution
return _setup_distribution
# run_setup ()

View File

@ -53,11 +53,9 @@ import copy
import re
from warnings import warn
from distutils.ccompiler import gen_preprocess_options, gen_lib_options
from distutils.unixccompiler import UnixCCompiler
from distutils.file_util import write_file
from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
from distutils import log
from distutils.util import get_compiler_versions
def get_msvcr():

View File

@ -4,7 +4,7 @@ Utility functions for manipulating directories and directory trees."""
__revision__ = "$Id$"
import os, sys
import os
from distutils.errors import DistutilsFileError, DistutilsInternalError
from distutils import log

View File

@ -14,7 +14,8 @@ try:
except ImportError:
warnings = None
from distutils.errors import *
from distutils.errors import (DistutilsOptionError, DistutilsArgError,
DistutilsModuleError, DistutilsClassError)
from distutils.fancy_getopt import FancyGetopt, translate_longopt
from distutils.util import check_environ, strtobool, rfc822_escape
from distutils import log

View File

@ -24,11 +24,9 @@ __revision__ = "$Id$"
import os, sys, copy
from warnings import warn
from distutils.ccompiler import gen_preprocess_options, gen_lib_options
from distutils.unixccompiler import UnixCCompiler
from distutils.file_util import write_file
from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
from distutils import log
from distutils.util import get_compiler_versions
class EMXCCompiler (UnixCCompiler):

View File

@ -6,7 +6,6 @@ modules in setup scripts."""
__revision__ = "$Id$"
import os
import sys
import warnings
# This class is really only used by the "build_ext" command, so it might

View File

@ -10,9 +10,11 @@ additional features:
__revision__ = "$Id$"
import sys, string, re
import sys
import string
import re
import getopt
from distutils.errors import *
from distutils.errors import DistutilsGetoptError, DistutilsArgError
# Much like command_re in distutils.core, this is close to but not quite
# the same as a Python NAME -- except, in the spirit of most GNU
@ -444,16 +446,3 @@ class OptionDummy:
'options' will be initialized to None."""
for opt in options:
setattr(self, opt, None)
if __name__ == "__main__":
text = """\
Tra-la-la, supercalifragilisticexpialidocious.
How *do* you spell that odd word, anyways?
(Someone ask Mary -- she'll know [or she'll
say, "How should I know?"].)"""
for w in (10, 20, 30, 40):
print("width: %d" % w)
print("\n".join(wrap_text(text, w)))
print()

View File

@ -19,10 +19,9 @@ import subprocess
import sys
import re
from distutils.errors import DistutilsExecError, DistutilsPlatformError, \
CompileError, LibError, LinkError
from distutils.ccompiler import CCompiler, gen_preprocess_options, \
gen_lib_options
from distutils.errors import (DistutilsExecError, DistutilsPlatformError,
CompileError, LibError, LinkError)
from distutils.ccompiler import CCompiler, gen_lib_options
from distutils import log
from distutils.util import get_platform

View File

@ -10,12 +10,12 @@ for the Microsoft Visual Studio.
__revision__ = "$Id$"
import sys, os
from distutils.errors import \
DistutilsExecError, DistutilsPlatformError, \
CompileError, LibError, LinkError
from distutils.ccompiler import \
CCompiler, gen_preprocess_options, gen_lib_options
import sys
import os
from distutils.errors import (DistutilsExecError, DistutilsPlatformError,
CompileError, LibError, LinkError)
from distutils.ccompiler import CCompiler, gen_lib_options
from distutils import log
_can_read_reg = False
@ -124,7 +124,7 @@ class MacroExpander:
self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1")
else:
self.set_macro("FrameworkSDKDir", net, "sdkinstallroot")
except KeyError as exc: #
except KeyError:
raise DistutilsPlatformError(
"""Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.

View File

@ -6,8 +6,8 @@ lines, and joining lines with backslashes."""
__revision__ = "$Id$"
import sys, os, io
import sys
import io
class TextFile:
"""Provides a file-like object that takes care of all the things you