Staging
v0.8.1
https://github.com/python/cpython
Revision 24f7c89e6387ae538c493babd3e62c548b834b4a authored by cvs2svn on 07 October 2002, 21:38:58 UTC, committed by cvs2svn on 07 October 2002, 21:38:58 UTC
1 parent be36d02
Raw File
Tip revision: 24f7c89e6387ae538c493babd3e62c548b834b4a authored by cvs2svn on 07 October 2002, 21:38:58 UTC
This commit was manufactured by cvs2svn to create tag 'r222b1'.
Tip revision: 24f7c89
FixCreator.py
#
# FixCreator - Search for files with PYTH creator
# and set it to Pyth.
#
import os
import macfs
import sys
import macostools

OLD='PYTH'
NEW='Pyth'

def walktree(name, change):
	if os.path.isfile(name):
		fs = macfs.FSSpec(name)
		cur_cr, cur_tp = fs.GetCreatorType()
		if cur_cr == OLD:
			fs.SetCreatorType(NEW, cur_tp)
			macostools.touched(fs)
			print 'Fixed ', name
	elif os.path.isdir(name):
		print '->', name
		files = os.listdir(name)
		for f in files:
			walktree(os.path.join(name, f), change)
			
def run(change):
	fss, ok = macfs.GetDirectory('Folder to search:')
	if not ok:
		sys.exit(0)
	walktree(fss.as_pathname(), change)
	
if __name__ == '__main__':
	run(1)
	
	
back to top