summaryrefslogtreecommitdiff
path: root/Lib/idlelib/setup.py
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2002-12-21 21:03:06 +0000
committerKurt B. Kaiser <kbk@shore.net>2002-12-21 21:03:06 +0000
commitdd70e1be91dcf4d20150f11cc0262c9e623b1fae (patch)
tree8aa283341bda49e2953e10629c5f8406586e2297 /Lib/idlelib/setup.py
parent9c36c29156bf7d6f2349a2ca577771dd68fe63a9 (diff)
downloadcpython-git-dd70e1be91dcf4d20150f11cc0262c9e623b1fae.tar.gz
M PyShell.py
M idle M setup.py To be able to run from the source directory or from an installed version of IDLE, and also to allow the subprocess to find run(), Python needs to have the idlelib package on its path. 1. Modify setup.py to supply a .pth file living at same level as idlelib 2. Move boolcheck to PyShell.py 3. Remove boolcheck and path setting code from the "idle" script
Diffstat (limited to 'Lib/idlelib/setup.py')
-rw-r--r--Lib/idlelib/setup.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/idlelib/setup.py b/Lib/idlelib/setup.py
index 2305adc3f3..02fd99745d 100644
--- a/Lib/idlelib/setup.py
+++ b/Lib/idlelib/setup.py
@@ -31,6 +31,15 @@ txt_files = ['extend.txt', 'help.txt', 'CREDITS.txt', 'LICENSE.txt']
txt_files += ['config-extensions.def', 'config-highlight.def',
'config-keys.def', 'config-main.def']
Icons = glob.glob1("Icons","*.gif")
+
+# Create a .pth file to live in site-packages; Python will add IDLE to
+# sys.path:
+
+pathfile = idle_name + ".pth"
+pfile = open(pathfile, 'w')
+pfile.write(pkgname +'\n')
+pfile.close()
+
class IDLE_Builder(build_py):
def get_plain_outfile(self, build_dir, package, file):
# like get_module_outfile, but does not append .py
@@ -54,6 +63,12 @@ class IDLE_Builder(build_py):
self.mkpath(dir)
self.copy_file(os.path.join("Icons", name),
outfile, preserve_mode = 0)
+ # Copy the .pth file to the same level as the package directory
+ outfile = self.get_plain_outfile(self.build_lib, [], pathfile)
+ dir = os.path.dirname(outfile)
+ self.mkpath(dir)
+ self.copy_file(os.path.join(package_dir, pathfile), outfile,
+ preserve_mode=0)
def get_source_files(self):
# returns the .py files, the .txt and .def files, and the icons