diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2000-09-12 20:24:50 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2000-09-12 20:24:50 (GMT) |
commit | 9c940ca1438b774b736863981e76ca81f459204f (patch) | |
tree | 73704d48e2a2e5fffe50ce0a67bef1d5cf6d2959 /Mac/Unsupported/FixCreator.py | |
parent | f913e542bee40dfb83642a903c74e76566694c69 (diff) | |
download | cpython-9c940ca1438b774b736863981e76ca81f459204f.zip cpython-9c940ca1438b774b736863981e76ca81f459204f.tar.gz cpython-9c940ca1438b774b736863981e76ca81f459204f.tar.bz2 |
Moved to Unsupported.
Diffstat (limited to 'Mac/Unsupported/FixCreator.py')
-rw-r--r-- | Mac/Unsupported/FixCreator.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Mac/Unsupported/FixCreator.py b/Mac/Unsupported/FixCreator.py new file mode 100644 index 0000000..b5b3a26 --- /dev/null +++ b/Mac/Unsupported/FixCreator.py @@ -0,0 +1,36 @@ +# +# 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) + + |