2 from distutils
.core
import setup
3 from distutils
.command
.build_py
import build_py
4 from distutils
.command
.install_lib
import install_lib
10 # the normal build_py would not incorporate the .txt files
11 txt_files
= ['config-unix.txt','config-win.txt','config.txt', 'help.txt']
12 Icons
= glob
.glob1("Icons","*.gif")
13 class idle_build_py(build_py
):
14 def get_plain_outfile(self
, build_dir
, package
, file):
15 # like get_module_outfile, but does not append .py
16 outfile_path
= [build_dir
] + list(package
) + [file]
17 return apply(os
.path
.join
, outfile_path
)
20 # Copies all .py files, then also copies the txt and gif files
22 assert self
.packages
== [idlelib
]
23 for name
in txt_files
:
24 outfile
= self
.get_plain_outfile(self
.build_lib
, [idlelib
], name
)
25 dir = os
.path
.dirname(outfile
)
27 self
.copy_file(name
, outfile
, preserve_mode
= 0)
29 outfile
= self
.get_plain_outfile(self
.build_lib
,
30 [idlelib
,"Icons"], name
)
31 dir = os
.path
.dirname(outfile
)
33 self
.copy_file(os
.path
.join("Icons",name
),
34 outfile
, preserve_mode
= 0)
36 def get_source_files(self
):
37 # returns the .py files, the .txt files, and the icons
38 icons
= [os
.path
.join("Icons",name
) for name
in Icons
]
39 return build_py
.get_source_files(self
)+txt_files
+icons
41 def get_outputs(self
, include_bytecode
=1):
42 # returns the built files
43 outputs
= build_py
.get_outputs(self
, include_bytecode
)
44 if not include_bytecode
:
46 for name
in txt_files
:
47 filename
= self
.get_plain_outfile(self
.build_lib
,
49 outputs
.append(filename
)
51 filename
= self
.get_plain_outfile(self
.build_lib
,
52 [idlelib
,"Icons"], name
)
53 outputs
.append(filename
)
56 # Arghhh. install_lib thinks that all files returned from build_py's
57 # get_outputs are bytecode files
59 class idle_install_lib(install_lib
):
60 def _bytecode_filenames(self
, files
):
61 files
= [n
for n
in files
if n
.endswith('.py')]
62 return install_lib
._bytecode
_filenames
(self
,files
)
65 version
= idlever
.IDLE_VERSION
,
66 description
= "IDLE Fork, the Forked Python IDE",
67 author
= "Guido van Rossum",
68 author_email
= "guido@python.org",
71 """IDLE is a Tkinter based IDE for Python. It is written in 100% pure
72 Python and works both on Windows and Unix. It features a multi-window
73 text editor with multiple undo, Python colorizing, and many other things,
74 as well as a Python shell window and a debugger.
76 IDLE Fork is a separate line of development which was initiated by D. Scherer
77 at CMU as part of Visual Python. It features execution in a separate
78 process, with a fresh environment for each run. For further details,
79 refer to idlefork.sourceforge.net.""",
81 cmdclass
= {'build_py':idle_build_py
,
82 'install_lib':idle_install_lib
},
83 package_dir
= {idlelib
:'.'},