Kaydet (Commit) da4d3c1e authored tarafından Kurt B. Kaiser's avatar Kurt B. Kaiser

M MANIFEST.in

M PyShell.py
M idlever.py
M setup.py

1. Update MANIFEST.in to include all non-pure Python files
2. PyShell and idlever reflect Rev 0.9a0
3. setup.py modified to install IDLE as a collection of modules with
   a .pth file living at the idlelib level in site-packages.  This was
   done to make it easier to run from the source directory prior to
   installing IDLE.  This approach may change back to the package
   technique depending on what happens with the Mac installation
   development.
üst d6844155
# Many of these entries are unnecessary because of the extra file copying
# built into IDLE's setup.py. However, if that should change, they may
# become necessary and meanwhile do no harm.
include *.bat
include *.def
include *.gif
include *.pyw
include *.txt include *.txt
include idle include idle
include MANIFEST.in include MANIFEST.in
......
...@@ -799,7 +799,7 @@ class PyShell(OutputWindow): ...@@ -799,7 +799,7 @@ class PyShell(OutputWindow):
def begin(self): def begin(self):
self.resetoutput() self.resetoutput()
self.write("Python %s on %s\n%s\nGRPC IDLE Fork %s\n" % self.write("Python %s on %s\n%s\nIDLEfork %s\n" %
(sys.version, sys.platform, self.COPYRIGHT, (sys.version, sys.platform, self.COPYRIGHT,
idlever.IDLE_VERSION)) idlever.IDLE_VERSION))
try: try:
......
IDLE_VERSION = "0.8.9" IDLE_VERSION = "0.9a0"
...@@ -6,6 +6,15 @@ import idlever ...@@ -6,6 +6,15 @@ import idlever
idle_name = "idle" idle_name = "idle"
# IDLE not being imported as a package by its script. It is now being
# installed as a collection of modules in a directory in .../site-packages/,
# with a .pth file which will add IDLE to sys.path
# Name of 'package' to be installed in site-packages:
pkgname = idle_name + "lib"
pkg_dir = "."
try: try:
pos = sys.argv.index("--check-tkinter") pos = sys.argv.index("--check-tkinter")
except ValueError: except ValueError:
...@@ -18,27 +27,14 @@ else: ...@@ -18,27 +27,14 @@ else:
print >>sys.stderr, "Cannot install IDLE without _tkinter" print >>sys.stderr, "Cannot install IDLE without _tkinter"
raise SystemExit raise SystemExit
try: # the normal build_py would not incorporate anything but .py files
package_dir = os.path.join(os.environ["SRCDIR"], "Tools", idle_name) txt_files = ['extend.txt', 'help.txt', 'CREDITS.txt', 'LICENSE.txt',
except KeyError: 'README.txt']
package_dir = "."
# name of package to be installed in site-packages
pkgname = idle_name + "lib"
# the normal build_py would not incorporate the .txt or config files
txt_files = ['extend.txt', 'help.txt', 'CREDITS.txt', 'LICENSE.txt']
txt_files += ['config-extensions.def', 'config-highlight.def', txt_files += ['config-extensions.def', 'config-highlight.def',
'config-keys.def', 'config-main.def'] 'config-keys.def', 'config-main.def']
Icons = glob.glob1("Icons","*.gif") txt_files += [idle_name + '.bat', idle_name + '.pyw']
# Create a .pth file to live in site-packages; Python will add IDLE to
# sys.path:
pathfile = idle_name + ".pth" Icons = glob.glob1("Icons","*.gif")
pfile = open(pathfile, 'w')
pfile.write(pkgname +'\n')
pfile.close()
class IDLE_Builder(build_py): class IDLE_Builder(build_py):
def get_plain_outfile(self, build_dir, package, file): def get_plain_outfile(self, build_dir, package, file):
...@@ -49,31 +45,24 @@ class IDLE_Builder(build_py): ...@@ -49,31 +45,24 @@ class IDLE_Builder(build_py):
def run(self): def run(self):
# Copies all .py files, then also copies the txt and gif files # Copies all .py files, then also copies the txt and gif files
build_py.run(self) build_py.run(self)
assert self.packages == [pkgname]
for name in txt_files: for name in txt_files:
outfile = self.get_plain_outfile(self.build_lib, [pkgname], name) outfile = self.get_plain_outfile(self.build_lib, [], name)
dir = os.path.dirname(outfile) dir = os.path.dirname(outfile)
self.mkpath(dir) self.mkpath(dir)
self.copy_file(os.path.join(package_dir, name), outfile, self.copy_file(os.path.join(pkg_dir, name), outfile,
preserve_mode = 0) preserve_mode = 0)
for name in Icons: for name in Icons:
outfile = self.get_plain_outfile(self.build_lib, outfile = self.get_plain_outfile(self.build_lib,
[pkgname, "Icons"], name) ["Icons"], name)
dir = os.path.dirname(outfile) dir = os.path.dirname(outfile)
self.mkpath(dir) self.mkpath(dir)
self.copy_file(os.path.join("Icons", name), self.copy_file(os.path.join("Icons", name),
outfile, preserve_mode = 0) 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): def get_source_files(self):
# returns the .py files, the .txt and .def files, and the icons # returns the .py files, the .txt and .def files, and the icons
icons = [os.path.join(package_dir, "Icons",name) for name in Icons] icons = [os.path.join(pkg_dir, "Icons",name) for name in Icons]
txts = [os.path.join(package_dir, name) for name in txt_files] txts = [os.path.join(pkg_dir, name) for name in txt_files]
return build_py.get_source_files(self) + txt_files + icons return build_py.get_source_files(self) + txt_files + icons
def get_outputs(self, include_bytecode=1): def get_outputs(self, include_bytecode=1):
...@@ -82,12 +71,11 @@ class IDLE_Builder(build_py): ...@@ -82,12 +71,11 @@ class IDLE_Builder(build_py):
if not include_bytecode: if not include_bytecode:
return outputs return outputs
for name in txt_files: for name in txt_files:
filename = self.get_plain_outfile(self.build_lib, filename = self.get_plain_outfile(self.build_lib, [], name)
[pkgname], name)
outputs.append(filename) outputs.append(filename)
for name in Icons: for name in Icons:
filename = self.get_plain_outfile(self.build_lib, filename = self.get_plain_outfile(self.build_lib,
[pkgname, "Icons"], name) ["Icons"], name)
outputs.append(filename) outputs.append(filename)
return outputs return outputs
...@@ -104,28 +92,26 @@ setup(name="IDLEfork", ...@@ -104,28 +92,26 @@ setup(name="IDLEfork",
description = "IDLEfork, the Developmental Python IDE", description = "IDLEfork, the Developmental Python IDE",
author = "Guido van Rossum et. al.", author = "Guido van Rossum et. al.",
author_email = "idle-dev@python.org", author_email = "idle-dev@python.org",
maintainer = "Kurt B. Kaiser",
maintainer_email = "kbk@shore.net",
license = "PSF: www.python.org", license = "PSF: www.python.org",
url = "https://sourceforge.net/projects/idlefork/", url = "https://sourceforge.net/projects/idlefork/",
long_description = long_description =
"""IDLE is a Tkinter based IDE for Python. It is written in 100% pure Python """IDLE is a Tkinter based IDE for Python. It is written in 100% pure
and works both on Windows and Unix. It features a multi-window text editor with Python and works both on Windows and Unix. It features a multi-window
multiple undo, Python colorizing, and many other things, as well as a Python text editor with multiple undo, Python colorizing, and many other
shell window and a debugger. things, as well as a Python shell window and a debugger.
IDLEfork is a separate line of development which was initiated by D. Scherer IDLEfork is a separate line of development which was initiated by
at CMU as part of Visual Python. It features execution in a separate process D. Scherer at CMU as part of Visual Python. It features execution in a
which is newly initiated for each run. At version 0.9 the RPC was changed to separate process which is newly initiated for each run. At version 0.9
incorporate code by GvR, which supports the debugger. IDLEfork also the RPC was changed to incorporate code by GvR, which supports the
incorporates a GUI configuration utilility. For further details, refer to debugger. IDLEfork also incorporates a GUI configuration utilility.
idlefork.sourceforge.net. For further details, refer to idlefork.sourceforge.net.
""", """,
cmdclass = {'build_py':IDLE_Builder, cmdclass = {'build_py':IDLE_Builder,
'install_lib':IDLE_Installer}, 'install_lib':IDLE_Installer},
package_dir = {pkgname: package_dir}, package_dir = {pkgname: pkg_dir},
packages = [pkgname], extra_path = pkgname,
scripts = [os.path.join(package_dir, idle_name)] py_modules = [f.split('.')[0] for f in glob.glob("*.py")],
scripts = [os.path.join(pkg_dir, idle_name)]
) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment