# XXX what about warnoptions?
return [sys.executable, '-p', str(self.port)]
else:
- w = ['-W' + s for s in sys.warnoptions]
- return [sys.executable] + w \
- + ["-c", "__import__('run').main()", str(self.port)]
+ w = ['-W' + s for s in sys.warnoptions]
+ # Maybe IDLE is installed and is being accessed via sys.path,
+ # or maybe it's not installed and the idle.py script is being
+ # run from the IDLE source directory.
+ if __name__ == 'idlelib.PyShell':
+ command = "__import__('idlelib.run').run.main()"
+ else:
+ command = "__import__('run').main()"
+ return [sys.executable] + w + ["-c", command, str(self.port)]
def start_subprocess(self):
addr = ("localhost", self.port)
# Copies all .py files, then also copies the txt and gif files
build_py.run(self)
for name in txt_files:
- outfile = self.get_plain_outfile(self.build_lib, [], name)
+ outfile = self.get_plain_outfile(self.build_lib, [pkgname], name)
dir = os.path.dirname(outfile)
self.mkpath(dir)
self.copy_file(os.path.join(pkg_dir, name), outfile,
preserve_mode = 0)
for name in Icons:
outfile = self.get_plain_outfile(self.build_lib,
- ["Icons"], name)
+ [pkgname, "Icons"], name)
dir = os.path.dirname(outfile)
self.mkpath(dir)
self.copy_file(os.path.join("Icons", name),
if not include_bytecode:
return outputs
for name in txt_files:
- filename = self.get_plain_outfile(self.build_lib, [], name)
+ filename = self.get_plain_outfile(self.build_lib, [pkgname], name)
outputs.append(filename)
for name in Icons:
filename = self.get_plain_outfile(self.build_lib,
- ["Icons"], name)
+ [pkgname, "Icons"], name)
outputs.append(filename)
return outputs
cmdclass = {'build_py':IDLE_Builder,
'install_lib':IDLE_Installer},
package_dir = {pkgname: pkg_dir},
- extra_path = pkgname,
- py_modules = [f.split('.')[0] for f in glob.glob("*.py")],
+ packages = [pkgname],
scripts = [os.path.join(pkg_dir, idle_name)]
)