declipse.py

来自「Thinking in JAVA第四版源代码」· Python 代码 · 共 25 行

PY
25
字号
#!/usr/bin/python
"""
DEclipse.py by Bruce Eckel, for Thinking in Java 4e

Undoes the effect of Eclipse.py, so that Ant can be used
again to build the code tree.

You must have Python 2.3 installed to run this program. See www.python.org.
"""
import os

for path, dirs, files in os.walk('.'):
    for file in files:
        if file.endswith(".java"):
            filepath = path + os.sep + file
            code = open(filepath).readlines()
            found = False
            for n, line in enumerate(code):
                if line.find(" /* Added by Eclipse.py */") != -1:
                    del code[n]
            open(filepath, 'w').writelines(code)


print "Project ready to be built with Ant."
       

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?