tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
]\¬Qc@sdZddlmZedddƒddlmZddlmZmZddlZddlZddl    Z    y e    j
Z
Wne k
r–e Z
nXd    Z d
ZejejBejBejBejBZdd „Zd „Zd „Zd„Zdddd„Zdd„ZdS(s¢macostools - Various utility functions for MacOS.
 
mkalias(src, dst) - Create a finder alias 'dst' pointing to 'src'
copy(src, dst) - Full copy of 'src' to 'dst'
iÿÿÿÿ(twarnpy3ks)In 3.x, the macostools module is removed.t
stackleveli(tRes(tFiletFilesNsmacostools.ErroricCstj|ƒ}tjj|ƒ\}}|s9tj}ntj|ƒ}|rrtj|ƒ}tj||ƒ}n |jƒ}tj    |t
|ƒtj ƒƒ\}    }
tj |    tj ƒdƒ} tj |jƒ} | jdddƒtj| ƒ|
jƒ} | jdB| _|
j| ƒdS(sCreate a finder aliasitalisiti€N(RtFSReftostpathtsplittcurdirt
FSNewAliastFSNewAliasMinimalRtFSCreateResourceFiletunicodetFSGetResourceForkNametFSOpenResourceFiletResourcetdatat AddResourcet CloseResFilet FSpGetFInfotFlagst FSpSetFInfo(tsrctdsttrelativetsrcfsrtdstdirtdstnamet    dstdirfsrt relativefsrtaliastdstfsrtdstfssthtresourcetdstfinfo((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/macostools.pytmkalias s$    cCs²|dkstjj|ƒr"dStjj|ƒ\}}tjdkrbd|krb|d}nt|ƒytj|dƒWn+tk
r­}|jtj    kr®‚q®nXdS(s9Make directories leading to 'dst' if they don't exist yetRNt:iÿ(
RR    texistsR
tseptmkdirstmkdirtOSErrorterrnotEEXIST(Rtheadttailte((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/macostools.pyR+:s 
cCs#ddl}|jdtdƒdS(s4Tell the finder a file has changed. No-op on MacOSX.iÿÿÿÿNs(macostools.touched() has been deprecatedi(twarningstwarntDeprecationWarning(RR3((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/macostools.pyttouchedKs     cCsZtjj|ƒd}|s(tj}nddl}|jƒ}|jtj|ƒƒdS(s"Tell the finder a file has changediiÿÿÿÿN(RR    R
R tFindertupdateRR(RtpardirR7tf((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/macostools.pyt
touched_aeQs    iicCsõtj|ƒ}tj|ƒ}|rAttjj|ƒdƒnt|dƒ}t|dƒ}|jtƒ}x&|r–|j    |ƒ|jtƒ}qqW|j
ƒ|j
ƒt |dƒ}t |dƒ}|jtƒ}x&|r|j    |ƒ|jtƒ}qÛW|j
ƒ|j
ƒtj |ƒ}tj |ƒ}    |j ƒ}
|    j ƒ} |
j|
j| _| _|dk    r||| _n|
jt@| _|    j| ƒ|rñtj|ƒ} tj|ƒ} | jtjƒ\}}}}| jtj|ƒndS(s6Copy a file, including finder info, resource fork, etcitrbtwbs*rbs*wbN(RtpathnameR+RR    R
topentreadtBUFSIZtwritetclosetopenrftFSSpecRtCreatortTypetNoneRt
COPY_FLAGSRRtFSGetCatalogInfoRtkFSCatInfoAllDatestFSSetCatalogInfo(RRt
createpatht    copydatest    forcetypetifptofptdtsrcfssR#tsftdfRR"tcatinfot_((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/macostools.pytcopyZsD     
 
     
 
     cCs„tjj|ƒrmt|ƒtj|ƒ}xR|D]4}ttjj||ƒtjj||ƒ|ƒq2Wnt||d|ƒdS(s.Copy a complete file tree to a new destinationiN(RR    tisdirR+tlistdirtcopytreetjoinRX(RRRNtfilesR:((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/macostools.pyR[‚s 
 5(t__doc__R3RtCarbonRRRRR.tMacOSRDtAttributeErrorR?tErrorRAt kIsStationaryt kNameLockedt
kHasBundlet kIsInvisibletkIsAliasRIRHR'R+R6R;RXR[(((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/macostools.pyt<module>s(     
%                 (