summaryrefslogtreecommitdiffstats
path: root/Mac/scripts/zappycfiles.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2004-07-18 06:16:08 (GMT)
committerTim Peters <tim.peters@gmail.com>2004-07-18 06:16:08 (GMT)
commit182b5aca27d376b08a2904bed42b751496f932f3 (patch)
treedf13115820dbc879c0fe2eae488c9f8c0215a7da /Mac/scripts/zappycfiles.py
parente6ddc8b20b493fef2e7cffb2e1351fe1d238857e (diff)
downloadcpython-182b5aca27d376b08a2904bed42b751496f932f3.zip
cpython-182b5aca27d376b08a2904bed42b751496f932f3.tar.gz
cpython-182b5aca27d376b08a2904bed42b751496f932f3.tar.bz2
Whitespace normalization, via reindent.py.
Diffstat (limited to 'Mac/scripts/zappycfiles.py')
-rw-r--r--Mac/scripts/zappycfiles.py45
1 files changed, 22 insertions, 23 deletions
diff --git a/Mac/scripts/zappycfiles.py b/Mac/scripts/zappycfiles.py
index 0349220..a8193c1 100644
--- a/Mac/scripts/zappycfiles.py
+++ b/Mac/scripts/zappycfiles.py
@@ -8,30 +8,29 @@ import sys
doit = 1
def main():
- if not sys.argv[1:]:
- if os.name == 'mac':
- import EasyDialogs
- dir = EasyDialogs.AskFolder(message='Directory to zap pyc files in')
- if not dir:
- sys.exit(0)
- zappyc(dir)
- else:
- print 'Usage: zappyc dir ...'
- sys.exit(1)
- for dir in sys.argv[1:]:
- zappyc(dir)
+ if not sys.argv[1:]:
+ if os.name == 'mac':
+ import EasyDialogs
+ dir = EasyDialogs.AskFolder(message='Directory to zap pyc files in')
+ if not dir:
+ sys.exit(0)
+ zappyc(dir)
+ else:
+ print 'Usage: zappyc dir ...'
+ sys.exit(1)
+ for dir in sys.argv[1:]:
+ zappyc(dir)
def zappyc(dir):
- os.path.walk(dir, walker, None)
-
+ os.path.walk(dir, walker, None)
+
def walker(dummy, top, names):
- for name in names:
- if name[-4:] in ('.pyc', '.pyo'):
- path = os.path.join(top, name)
- print 'Zapping', path
- if doit:
- os.unlink(path)
-
+ for name in names:
+ if name[-4:] in ('.pyc', '.pyo'):
+ path = os.path.join(top, name)
+ print 'Zapping', path
+ if doit:
+ os.unlink(path)
+
if __name__ == '__main__':
- main()
-
+ main()