[Python-checkins] python/dist/src/Mac/scripts findgremlins.py,1.2,1.3
jackjansen@users.sourceforge.net
jackjansen@users.sourceforge.net
Wed, 05 Feb 2003 15:10:49 -0800
Update of /cvsroot/python/python/dist/src/Mac/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv2313
Modified Files:
findgremlins.py
Log Message:
Got rid of macfs and made a bit more OSX-friendly.
Index: findgremlins.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/scripts/findgremlins.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** findgremlins.py 26 Jan 2003 21:40:00 -0000 1.2
--- findgremlins.py 5 Feb 2003 23:10:46 -0000 1.3
***************
*** 6,10 ****
import EasyDialogs
! import macfs
import re
import os
--- 6,10 ----
import EasyDialogs
! import MacOS
import re
import os
***************
*** 21,26 ****
walk(path)
else:
! cr, tp = macfs.FSSpec(top).GetCreatorType()
! if tp == 'TEXT' and top[-4:] <> ".hqx":
data = open(top).read()
badcount = 0
--- 21,26 ----
walk(path)
else:
! cr, tp = MacOS.GetCreatorAndType(top)
! if tp in ('TEXT', '\0\0\0\0') and top[-4:] <> ".hqx":
data = open(top).read()
badcount = 0
***************
*** 45,54 ****
def main():
! pathname = EasyDialogs.AskFolder()
! if pathname:
! walk(pathname)
if __name__ == '__main__':
main()
- sys.exit(1) # So we see the output
--- 45,57 ----
def main():
! if sys.argv[1:]:
! for pathname in sys.argv[1:]:
! walk(pathname)
! else:
! pathname = EasyDialogs.AskFolder()
! if pathname:
! walk(pathname)
if __name__ == '__main__':
main()