File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55By Just, with a little glue by Jack"""
66
77import EasyDialogs
8- import macfs
8+ import MacOS
99import re
1010import os
1111import string
@@ -20,8 +20,8 @@ def walk(top, recurse=1):
2020 path = os .path .join (top , name )
2121 walk (path )
2222 else :
23- cr , tp = macfs . FSSpec (top ). GetCreatorType ( )
24- if tp == 'TEXT' and top [- 4 :] <> ".hqx" :
23+ cr , tp = MacOS . GetCreatorAndType (top )
24+ if tp in ( 'TEXT' , ' \0 \0 \0 \0 ' ) and top [- 4 :] <> ".hqx" :
2525 data = open (top ).read ()
2626 badcount = 0
2727 for ch in data [:256 ]:
@@ -44,11 +44,14 @@ def walk(top, recurse=1):
4444 pos = j
4545
4646def main ():
47- pathname = EasyDialogs .AskFolder ()
48- if pathname :
49- walk (pathname )
47+ if sys .argv [1 :]:
48+ for pathname in sys .argv [1 :]:
49+ walk (pathname )
50+ else :
51+ pathname = EasyDialogs .AskFolder ()
52+ if pathname :
53+ walk (pathname )
5054
5155if __name__ == '__main__' :
5256 main ()
53- sys .exit (1 ) # So we see the output
5457
You can’t perform that action at this time.
0 commit comments