diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-11-30 17:54:17 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-11-30 17:54:17 (GMT) |
commit | 3e0edbf4d8cc7728fb75cb23602ca18c0282c192 (patch) | |
tree | 53edbb9239cab863eaebfc9efc583ac3efad9839 /Lib | |
parent | ce8ed1a8d5ea4095da041f2d389998d98b13f14b (diff) | |
download | cpython-3e0edbf4d8cc7728fb75cb23602ca18c0282c192.zip cpython-3e0edbf4d8cc7728fb75cb23602ca18c0282c192.tar.gz cpython-3e0edbf4d8cc7728fb75cb23602ca18c0282c192.tar.bz2 |
Port Martin von Loewis checkin from Python:
Add --check-tkinter to setup.py. Install IDLE. Fixes #634078.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/idlelib/setup.py | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/Lib/idlelib/setup.py b/Lib/idlelib/setup.py index e683512..75a839c 100644 --- a/Lib/idlelib/setup.py +++ b/Lib/idlelib/setup.py @@ -1,9 +1,26 @@ -import os,glob +import os, glob, sys from distutils.core import setup from distutils.command.build_py import build_py from distutils.command.install_lib import install_lib import idlever +try: + pos = sys.argv.index("--check-tkinter") +except ValueError: + pass +else: + del sys.argv[pos] + try: + import _tkinter + except ImportError: + print >>sys.stderr, "Cannot install IDLE without _tkinter" + raise SystemExit + +try: + package_dir = os.path.join(os.environ["SRCDIR"], "Tools", "idle") +except KeyError: + package_dir = "." + # name of idle package idlelib = "idlelib" @@ -24,7 +41,8 @@ class idle_build_py(build_py): outfile = self.get_plain_outfile(self.build_lib, [idlelib], name) dir = os.path.dirname(outfile) self.mkpath(dir) - self.copy_file(name, outfile, preserve_mode = 0) + self.copy_file(os.path.join(package_dir, name), outfile, + preserve_mode = 0) for name in Icons: outfile = self.get_plain_outfile(self.build_lib, [idlelib,"Icons"], name) @@ -35,7 +53,8 @@ class idle_build_py(build_py): def get_source_files(self): # returns the .py files, the .txt files, and the icons - icons = [os.path.join("Icons",name) for name in Icons] + icons = [os.path.join(package_dir, "Icons",name) for name in Icons] + txts = [os.path.join(package_dir, name) for name in txt_files] return build_py.get_source_files(self)+txt_files+icons def get_outputs(self, include_bytecode=1): @@ -80,7 +99,7 @@ refer to idlefork.sourceforge.net.""", cmdclass = {'build_py':idle_build_py, 'install_lib':idle_install_lib}, - package_dir = {idlelib:'.'}, + package_dir = {idlelib: package_dir}, packages = [idlelib], - scripts = ['idle'] + scripts = [os.path.join(package_dir, 'idle')] ) |