From c1463c98709bb62c6135f6e22afccdcc3fc765a7 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Tue, 6 Mar 2001 22:46:25 +0000 Subject: macostools.copy() now has an optional forcetype flag, which sets the filetype. This is used by various tools to set the type to APPL when copying interpreter template files (Atmp filetype). --- Mac/Lib/macostools.py | 4 +++- Mac/scripts/ConfigurePython.py | 2 +- Mac/scripts/fullbuild.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Mac/Lib/macostools.py b/Mac/Lib/macostools.py index 5b12fc0..d706856 100644 --- a/Mac/Lib/macostools.py +++ b/Mac/Lib/macostools.py @@ -78,7 +78,7 @@ def touched_ae(dst): dir_fss = macfs.FSSpec((vRefNum, dirID, '')) f.update(dir_fss) -def copy(src, dst, createpath=0, copydates=1): +def copy(src, dst, createpath=0, copydates=1, forcetype=None): """Copy a file, including finder info, resource fork, etc""" if createpath: mkdirs(os.path.split(dst)[0]) @@ -106,6 +106,8 @@ def copy(src, dst, createpath=0, copydates=1): sf = srcfss.GetFInfo() df = dstfss.GetFInfo() df.Creator, df.Type = sf.Creator, sf.Type + if forcetype != None: + df.Type = forcetype df.Flags = (sf.Flags & (kIsStationary|kNameLocked|kHasBundle|kIsInvisible|kIsAlias)) dstfss.SetFInfo(df) if copydates: diff --git a/Mac/scripts/ConfigurePython.py b/Mac/scripts/ConfigurePython.py index ec4dab4..aabaaf6 100644 --- a/Mac/scripts/ConfigurePython.py +++ b/Mac/scripts/ConfigurePython.py @@ -102,7 +102,7 @@ def buildcopy(top, dummy, list): for src, dst in list: src = os.path.join(top, src) dst = os.path.join(top, dst) - macostools.copy(src, dst) + macostools.copy(src, dst, forcetype="APPL") def main(): verbose = 0 diff --git a/Mac/scripts/fullbuild.py b/Mac/scripts/fullbuild.py index 4d18c08..3337512 100644 --- a/Mac/scripts/fullbuild.py +++ b/Mac/scripts/fullbuild.py @@ -167,7 +167,7 @@ def buildcopy(top, dummy, list): for src, dst in list: src = os.path.join(top, src) dst = os.path.join(top, dst) - macostools.copy(src, dst) + macostools.copy(src, dst, forcetype="APPL") def handle_dialog(filename): """Handle selection dialog, return list of selected items""" -- cgit v0.12