mirror of https://github.com/python/cpython
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:
parent
8b9361a26d
commit
88e2c5d35a
|
@ -13,13 +13,11 @@ for the Borland C++ compiler.
|
||||||
|
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from distutils.errors import \
|
|
||||||
DistutilsExecError, DistutilsPlatformError, \
|
from distutils.errors import (DistutilsExecError, CompileError, LibError,
|
||||||
CompileError, LibError, LinkError, UnknownFileError
|
LinkError, UnknownFileError)
|
||||||
from distutils.ccompiler import \
|
from distutils.ccompiler import CCompiler, gen_preprocess_options
|
||||||
CCompiler, gen_preprocess_options, gen_lib_options
|
|
||||||
from distutils.file_util import write_file
|
from distutils.file_util import write_file
|
||||||
from distutils.dep_util import newer
|
from distutils.dep_util import newer
|
||||||
from distutils import log
|
from distutils import log
|
||||||
|
|
|
@ -5,8 +5,11 @@ for the Distutils compiler abstraction model."""
|
||||||
|
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
import sys, os, re
|
import sys
|
||||||
from distutils.errors import *
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
|
from distutils.errors import CompileError, LinkError, UnknownFileError
|
||||||
from distutils.spawn import spawn
|
from distutils.spawn import spawn
|
||||||
from distutils.file_util import move_file
|
from distutils.file_util import move_file
|
||||||
from distutils.dir_util import mkpath
|
from distutils.dir_util import mkpath
|
||||||
|
|
|
@ -6,8 +6,9 @@ distribution)."""
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from distutils.core import Command
|
from distutils.core import Command
|
||||||
from distutils.errors import *
|
from distutils.errors import DistutilsPlatformError, DistutilsOptionError
|
||||||
from distutils.util import get_platform
|
from distutils.util import get_platform
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@ class PyDialog(Dialog):
|
||||||
default, cancel, bitmap=true)"""
|
default, cancel, bitmap=true)"""
|
||||||
Dialog.__init__(self, *args)
|
Dialog.__init__(self, *args)
|
||||||
ruler = self.h - 36
|
ruler = self.h - 36
|
||||||
bmwidth = 152*ruler/328
|
|
||||||
#if kw.get("bitmap", True):
|
#if kw.get("bitmap", True):
|
||||||
# self.bitmap("Bitmap", 0, 0, bmwidth, ruler, "PythonWin")
|
# self.bitmap("Bitmap", 0, 0, bmwidth, ruler, "PythonWin")
|
||||||
self.line("BottomLine", 0, ruler, self.w, 0)
|
self.line("BottomLine", 0, ruler, self.w, 0)
|
||||||
|
@ -419,7 +418,6 @@ class bdist_msi(Command):
|
||||||
# see "Dialog Style Bits"
|
# see "Dialog Style Bits"
|
||||||
modal = 3 # visible | modal
|
modal = 3 # visible | modal
|
||||||
modeless = 1 # visible
|
modeless = 1 # visible
|
||||||
track_disk_space = 32
|
|
||||||
|
|
||||||
# UI customization properties
|
# UI customization properties
|
||||||
add_data(db, "Property",
|
add_data(db, "Property",
|
||||||
|
|
|
@ -5,13 +5,14 @@ distributions)."""
|
||||||
|
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
import sys, os
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
from distutils.core import Command
|
from distutils.core import Command
|
||||||
from distutils.debug import DEBUG
|
from distutils.debug import DEBUG
|
||||||
from distutils.util import get_platform
|
|
||||||
from distutils.file_util import write_file
|
from distutils.file_util import write_file
|
||||||
from distutils.errors import *
|
from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
|
||||||
from distutils.sysconfig import get_python_version
|
DistutilsFileError, DistutilsExecError)
|
||||||
from distutils import log
|
from distutils import log
|
||||||
|
|
||||||
class bdist_rpm(Command):
|
class bdist_rpm(Command):
|
||||||
|
|
|
@ -5,11 +5,13 @@ exe-program."""
|
||||||
|
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
import sys, os
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
from distutils.core import Command
|
from distutils.core import Command
|
||||||
from distutils.util import get_platform
|
from distutils.util import get_platform
|
||||||
from distutils.dir_util import create_tree, remove_tree
|
from distutils.dir_util import remove_tree
|
||||||
from distutils.errors import *
|
from distutils.errors import DistutilsOptionError, DistutilsPlatformError
|
||||||
from distutils.sysconfig import get_python_version
|
from distutils.sysconfig import get_python_version
|
||||||
from distutils import log
|
from distutils import log
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ __revision__ = "$Id$"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from distutils.core import Command
|
from distutils.core import Command
|
||||||
from distutils.errors import *
|
from distutils.errors import DistutilsSetupError
|
||||||
from distutils.sysconfig import customize_compiler
|
from distutils.sysconfig import customize_compiler
|
||||||
from distutils import log
|
from distutils import log
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,8 @@ import sys, os, re
|
||||||
from warnings import warn
|
from warnings import warn
|
||||||
|
|
||||||
from distutils.core import Command
|
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.sysconfig import customize_compiler, get_python_version
|
||||||
from distutils.dep_util import newer_group
|
from distutils.dep_util import newer_group
|
||||||
from distutils.extension import Extension
|
from distutils.extension import Extension
|
||||||
|
|
|
@ -133,7 +133,6 @@ class build_py(Command):
|
||||||
|
|
||||||
def build_package_data(self):
|
def build_package_data(self):
|
||||||
"""Copy data files into build directory"""
|
"""Copy data files into build directory"""
|
||||||
lastdir = None
|
|
||||||
for package, src_dir, build_dir, filenames in self.data_files:
|
for package, src_dir, build_dir, filenames in self.data_files:
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
target = os.path.join(build_dir, filename)
|
target = os.path.join(build_dir, filename)
|
||||||
|
|
|
@ -11,7 +11,8 @@ this header file lives".
|
||||||
|
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
import sys, os, re
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
from distutils.core import Command
|
from distutils.core import Command
|
||||||
from distutils.errors import DistutilsExecError
|
from distutils.errors import DistutilsExecError
|
||||||
|
|
|
@ -7,13 +7,15 @@ Implements the Distutils 'register' command (register with the repository).
|
||||||
|
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
import os, string, getpass
|
import os
|
||||||
|
import string
|
||||||
|
import getpass
|
||||||
import io
|
import io
|
||||||
import urllib.parse, urllib.request
|
import urllib.parse
|
||||||
|
import urllib.request
|
||||||
from warnings import warn
|
from warnings import warn
|
||||||
|
|
||||||
from distutils.core import PyPIRCCommand
|
from distutils.core import PyPIRCCommand
|
||||||
from distutils.errors import *
|
|
||||||
from distutils import log
|
from distutils import log
|
||||||
|
|
||||||
class register(PyPIRCCommand):
|
class register(PyPIRCCommand):
|
||||||
|
|
|
@ -7,14 +7,14 @@ __revision__ = "$Id$"
|
||||||
import os
|
import os
|
||||||
import string
|
import string
|
||||||
import sys
|
import sys
|
||||||
from types import *
|
|
||||||
from glob import glob
|
from glob import glob
|
||||||
from warnings import warn
|
from warnings import warn
|
||||||
|
|
||||||
from distutils.core import Command
|
from distutils.core import Command
|
||||||
from distutils import dir_util, dep_util, file_util, archive_util
|
from distutils import dir_util, dep_util, file_util, archive_util
|
||||||
from distutils.text_file import TextFile
|
from distutils.text_file import TextFile
|
||||||
from distutils.errors import *
|
from distutils.errors import (DistutilsPlatformError, DistutilsOptionError,
|
||||||
|
DistutilsTemplateError)
|
||||||
from distutils.filelist import FileList
|
from distutils.filelist import FileList
|
||||||
from distutils import log
|
from distutils import log
|
||||||
from distutils.util import convert_path
|
from distutils.util import convert_path
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
"""distutils.command.upload
|
"""distutils.command.upload
|
||||||
|
|
||||||
Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
|
Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
|
||||||
import sys
|
import os
|
||||||
import os, io
|
import io
|
||||||
import socket
|
import socket
|
||||||
import platform
|
import platform
|
||||||
from urllib.request import urlopen, Request, HTTPError
|
from urllib.request import urlopen, Request, HTTPError
|
||||||
|
@ -10,7 +10,7 @@ from base64 import standard_b64encode
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
|
|
||||||
from distutils.errors import *
|
from distutils.errors import DistutilsOptionError
|
||||||
from distutils.core import PyPIRCCommand
|
from distutils.core import PyPIRCCommand
|
||||||
from distutils.spawn import spawn
|
from distutils.spawn import spawn
|
||||||
from distutils import log
|
from distutils import log
|
||||||
|
|
|
@ -4,7 +4,6 @@ Provides the PyPIRCCommand class, the base class for the command classes
|
||||||
that uses .pypirc in the distutils.command package.
|
that uses .pypirc in the distutils.command package.
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
|
|
||||||
from distutils.cmd import Command
|
from distutils.cmd import Command
|
||||||
|
@ -60,8 +59,6 @@ class PyPIRCCommand(Command):
|
||||||
if os.path.exists(rc):
|
if os.path.exists(rc):
|
||||||
self.announce('Using PyPI login from %s' % rc)
|
self.announce('Using PyPI login from %s' % rc)
|
||||||
repository = self.repository or self.DEFAULT_REPOSITORY
|
repository = self.repository or self.DEFAULT_REPOSITORY
|
||||||
realm = self.realm or self.DEFAULT_REALM
|
|
||||||
|
|
||||||
config = ConfigParser()
|
config = ConfigParser()
|
||||||
config.read(rc)
|
config.read(rc)
|
||||||
sections = config.sections()
|
sections = config.sections()
|
||||||
|
|
|
@ -8,10 +8,12 @@ really defined in distutils.dist and distutils.cmd.
|
||||||
|
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
import sys, os
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
from distutils.debug import DEBUG
|
from distutils.debug import DEBUG
|
||||||
from distutils.errors import *
|
from distutils.errors import (DistutilsSetupError, DistutilsArgError,
|
||||||
|
DistutilsError, CCompilerError)
|
||||||
from distutils.util import grok_environment_error
|
from distutils.util import grok_environment_error
|
||||||
|
|
||||||
# Mainly import these so setup scripts can "from distutils.core import" them.
|
# 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
|
or: %(script)s cmd --help
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def gen_usage (script_name):
|
def gen_usage(script_name):
|
||||||
script = os.path.basename(script_name)
|
script = os.path.basename(script_name)
|
||||||
return USAGE % vars()
|
return USAGE % vars()
|
||||||
|
|
||||||
|
@ -56,7 +58,7 @@ extension_keywords = ('name', 'sources', 'include_dirs',
|
||||||
'extra_objects', 'extra_compile_args', 'extra_link_args',
|
'extra_objects', 'extra_compile_args', 'extra_link_args',
|
||||||
'swig_opts', 'export_symbols', 'depends', 'language')
|
'swig_opts', 'export_symbols', 'depends', 'language')
|
||||||
|
|
||||||
def setup (**attrs):
|
def setup(**attrs):
|
||||||
"""The gateway to the Distutils: do everything your setup script needs
|
"""The gateway to the Distutils: do everything your setup script needs
|
||||||
to do, in a highly flexible and user-driven way. Briefly: create a
|
to do, in a highly flexible and user-driven way. Briefly: create a
|
||||||
Distribution instance; find and parse config files; parse the command
|
Distribution instance; find and parse config files; parse the command
|
||||||
|
@ -168,10 +170,8 @@ def setup (**attrs):
|
||||||
|
|
||||||
return dist
|
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
|
"""Run a setup script in a somewhat controlled environment, and
|
||||||
return the Distribution instance that drives things. This is useful
|
return the Distribution instance that drives things. This is useful
|
||||||
if you need to find out the distribution meta-data (passed as
|
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
|
# I wonder if the setup script's namespace -- g and l -- would be of
|
||||||
# any interest to callers?
|
# any interest to callers?
|
||||||
#print "_setup_distribution:", _setup_distribution
|
|
||||||
return _setup_distribution
|
return _setup_distribution
|
||||||
|
|
||||||
# run_setup ()
|
|
||||||
|
|
|
@ -53,11 +53,9 @@ import copy
|
||||||
import re
|
import re
|
||||||
from warnings import warn
|
from warnings import warn
|
||||||
|
|
||||||
from distutils.ccompiler import gen_preprocess_options, gen_lib_options
|
|
||||||
from distutils.unixccompiler import UnixCCompiler
|
from distutils.unixccompiler import UnixCCompiler
|
||||||
from distutils.file_util import write_file
|
from distutils.file_util import write_file
|
||||||
from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
|
from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
|
||||||
from distutils import log
|
|
||||||
from distutils.util import get_compiler_versions
|
from distutils.util import get_compiler_versions
|
||||||
|
|
||||||
def get_msvcr():
|
def get_msvcr():
|
||||||
|
|
|
@ -4,7 +4,7 @@ Utility functions for manipulating directories and directory trees."""
|
||||||
|
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
import os, sys
|
import os
|
||||||
from distutils.errors import DistutilsFileError, DistutilsInternalError
|
from distutils.errors import DistutilsFileError, DistutilsInternalError
|
||||||
from distutils import log
|
from distutils import log
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,8 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
warnings = None
|
warnings = None
|
||||||
|
|
||||||
from distutils.errors import *
|
from distutils.errors import (DistutilsOptionError, DistutilsArgError,
|
||||||
|
DistutilsModuleError, DistutilsClassError)
|
||||||
from distutils.fancy_getopt import FancyGetopt, translate_longopt
|
from distutils.fancy_getopt import FancyGetopt, translate_longopt
|
||||||
from distutils.util import check_environ, strtobool, rfc822_escape
|
from distutils.util import check_environ, strtobool, rfc822_escape
|
||||||
from distutils import log
|
from distutils import log
|
||||||
|
|
|
@ -24,11 +24,9 @@ __revision__ = "$Id$"
|
||||||
import os, sys, copy
|
import os, sys, copy
|
||||||
from warnings import warn
|
from warnings import warn
|
||||||
|
|
||||||
from distutils.ccompiler import gen_preprocess_options, gen_lib_options
|
|
||||||
from distutils.unixccompiler import UnixCCompiler
|
from distutils.unixccompiler import UnixCCompiler
|
||||||
from distutils.file_util import write_file
|
from distutils.file_util import write_file
|
||||||
from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
|
from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
|
||||||
from distutils import log
|
|
||||||
from distutils.util import get_compiler_versions
|
from distutils.util import get_compiler_versions
|
||||||
|
|
||||||
class EMXCCompiler (UnixCCompiler):
|
class EMXCCompiler (UnixCCompiler):
|
||||||
|
|
|
@ -6,7 +6,6 @@ modules in setup scripts."""
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
# This class is really only used by the "build_ext" command, so it might
|
# This class is really only used by the "build_ext" command, so it might
|
||||||
|
|
|
@ -10,9 +10,11 @@ additional features:
|
||||||
|
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
import sys, string, re
|
import sys
|
||||||
|
import string
|
||||||
|
import re
|
||||||
import getopt
|
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
|
# 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
|
# 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."""
|
'options' will be initialized to None."""
|
||||||
for opt in options:
|
for opt in options:
|
||||||
setattr(self, opt, None)
|
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()
|
|
||||||
|
|
|
@ -19,10 +19,9 @@ import subprocess
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from distutils.errors import DistutilsExecError, DistutilsPlatformError, \
|
from distutils.errors import (DistutilsExecError, DistutilsPlatformError,
|
||||||
CompileError, LibError, LinkError
|
CompileError, LibError, LinkError)
|
||||||
from distutils.ccompiler import CCompiler, gen_preprocess_options, \
|
from distutils.ccompiler import CCompiler, gen_lib_options
|
||||||
gen_lib_options
|
|
||||||
from distutils import log
|
from distutils import log
|
||||||
from distutils.util import get_platform
|
from distutils.util import get_platform
|
||||||
|
|
||||||
|
|
|
@ -10,12 +10,12 @@ for the Microsoft Visual Studio.
|
||||||
|
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
import sys, os
|
import sys
|
||||||
from distutils.errors import \
|
import os
|
||||||
DistutilsExecError, DistutilsPlatformError, \
|
|
||||||
CompileError, LibError, LinkError
|
from distutils.errors import (DistutilsExecError, DistutilsPlatformError,
|
||||||
from distutils.ccompiler import \
|
CompileError, LibError, LinkError)
|
||||||
CCompiler, gen_preprocess_options, gen_lib_options
|
from distutils.ccompiler import CCompiler, gen_lib_options
|
||||||
from distutils import log
|
from distutils import log
|
||||||
|
|
||||||
_can_read_reg = False
|
_can_read_reg = False
|
||||||
|
@ -124,7 +124,7 @@ class MacroExpander:
|
||||||
self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1")
|
self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1")
|
||||||
else:
|
else:
|
||||||
self.set_macro("FrameworkSDKDir", net, "sdkinstallroot")
|
self.set_macro("FrameworkSDKDir", net, "sdkinstallroot")
|
||||||
except KeyError as exc: #
|
except KeyError:
|
||||||
raise DistutilsPlatformError(
|
raise DistutilsPlatformError(
|
||||||
"""Python was built with Visual Studio 2003;
|
"""Python was built with Visual Studio 2003;
|
||||||
extensions must be built with a compiler than can generate compatible binaries.
|
extensions must be built with a compiler than can generate compatible binaries.
|
||||||
|
|
|
@ -6,8 +6,8 @@ lines, and joining lines with backslashes."""
|
||||||
|
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
import sys, os, io
|
import sys
|
||||||
|
import io
|
||||||
|
|
||||||
class TextFile:
|
class TextFile:
|
||||||
"""Provides a file-like object that takes care of all the things you
|
"""Provides a file-like object that takes care of all the things you
|
||||||
|
|
Loading…
Reference in New Issue