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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
]\¬Qc@s»dZddlmZedddƒddlZddlmZddlZddlZddlZddl    Zddl
Zddl Z ddl Td    Z d
Zdad „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zdd„Zd„Zd„Zd„Zdd@d„ƒYZ d„Z!d„Z"d„Z#d„Z$d „Z%dd!„Z&d"„Z'd#„Z(dd$„Z)d%„Z*d&„Z+dd'„Z,d(d)„Z-d*„Z.dd+„Z/d,„Z0d-„Z1dd.„Z2d/„Z3d0„Z4dd1„Z5d2„Z6d3„Z7dddd4„Z8d5„Z9d6„Z:d7„Z;d8„Z<d9„Z=d:„Z>d;„Z?d<„Z@d=„ZAd>„ZBeCd?kr·e@ƒeAƒeBƒndS(AsRUtility routines depending on the finder,
a combination of code by Jack Jansen and erik@letterror.com.
 
Most events have been captured from
Lasso Capture AE and than translated to python code.
 
IMPORTANT
Note that the processes() function returns different values
depending on the OS version it is running on. On MacOS 9
the Finder returns the process *names* which can then be
used to find out more about them. On MacOS 8.6 and earlier
the Finder returns a code which does not seem to work.
So bottom line: the processes() stuff does not work on < MacOS9
 
Mostly written by erik@letterror.com
iÿÿÿÿ(twarnpy3ks*In 3.x, the findertools module is removed.t
stackleveliN(t AppleEvents(t*s1.1sfindertools.ErrorcCs3tstjƒantjtjBtjBt_tS(s5returns basic (recyclable) Finder AE interface object(t_finder_talkertFindert
send_flagsRtkAECanInteracttkAECanSwitchLayer(((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt
_getfinder$scCs(tƒ}tjj|ƒ}|j|ƒS(s;Open a file thru the finder. Specify file by name or fsspec(R    tCarbontFiletFSSpectopen(tfiletfindertfss((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pytlaunch-s    cCs(tƒ}tjj|ƒ}|j|ƒS(s<Print a file thru the finder. Specify file by name or fsspec(R    R
R R t_print(RRR((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pytPrint3s    cCs‹tƒ}t|ƒtgƒkrTg}x<|D]}|jtjj|ƒƒq.Wntjj|ƒ}tjj|ƒ}|j|d|ƒS(sCopy a file to a foldertto(R    ttypetappendR
R R t    duplicate(tsrctdstdirRtsrc_fsststdst_fss((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pytcopy9s      cCs‹tƒ}t|ƒtgƒkrTg}x<|D]}|jtjj|ƒƒq.Wntjj|ƒ}tjj|ƒ}|j|d|ƒS(sMove a file to a folderR(R    RRR
R R tmove(RRRRRR((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyREs      cCstƒ}|jƒdS(sPut the mac to sleepN(R    tsleep(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyRQs    cCstƒ}|jƒdS(sShut the mac downN(R    t    shut_down(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pytshutdownVs    cCstƒ}|jƒdS(sRestart the macN(R    trestart(R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR"[s    cCs4tƒ}tjj|ƒ}|jƒ}|j|ƒS(sCReveal a file in the finder. Specify file by name, fsref or fsspec.(R    R
R tFSReftFSNewAliasMinimaltreveal(RRtfsrt
file_alias((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR%es     cCs4tƒ}tjj|ƒ}|jƒ}|j|ƒS(sCselect a file in the finder. Specify file by name, fsref or fsspec.(R    R
R R#R$tselect(RRR&R'((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR(ls     cCs4tƒ}tjj|ƒ}|jƒ}|j|ƒS(sUpdate the display of the specified object(s) to match
    their on-disk representation. Specify file by name, fsref or fsspec.(R    R
R R#R$tupdate(RRR&R'((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR)ss     cCsEtjj|ƒ}|jƒ}|dkr4t|ƒSt||ƒSdS(sWcomment: get or set the Finder-comment of the item, displayed in the 'Get Info' window.N(R
R R#R$tNonet _getcommentt _setcomment(tobjecttcommentt object_alias((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR.€s
 
c    Csætƒ}i}i}tjdtjdƒddd|ddƒ}tjdtjdƒdddtjdƒd|ƒ}||d    <||d
<|jd d ||ƒ\}}}d |krÎttj|ƒ‚nd    |krâ|d    SdS(Ntwanttcobjtformtalistseldtfrtproptcomts----tdatatcoretsetdterrn(    R    taetypestObjectSpecifiertTypeR*tsendtErrortaetoolst decodeerror(R/R.Rtargstattrstaeobj_00taeobj_01t_reply((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR,‰s    -6
 
!  c    CsÜtƒ}i}i}tjdtjdƒddd|ddƒ}tjdtjdƒdddtjdƒd|ƒ}||d    <|jd
d ||ƒ\}}}d |krÄttj|ƒ‚nd    |krØ|d    SdS( NR0R1R2R3R4R5R6R7s----R9tgetdR;(    R    R<R=R>R*R?R@RARB(R/RRCRDRERFRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR+—s    -6
!  c    Cs‚tƒ}i}i}g}g}g}g}g}tjdtjdƒdddtjddƒddƒ|d    <|jd
d ||ƒ\}}}d |kr²ttj    |ƒ‚ng}    d    |kr8|d    }    xg|    D]\}
t
|
dƒrý|j |
j ƒqÕt
|
d ƒrÕ|
j dkr1|j |
jƒq1qÕqÕWni}i}tjdtjdƒdddtjddƒddƒ} tjdtjdƒdddtjdƒd| ƒ|d    <|jd
d ||ƒ\}}}d |krùttj    tƒ‚nd    |kr|d    }    |    }ng} t|ƒt|ƒkr@|} n|} x5tt|ƒƒD]!}| j | |||fƒqYW| S(s]processes returns a list of all active processes running on this computer and their creators.R0tprcsR2tindxR4tabsosall R5s----R9RHR;Rspsn R6tfcrtN(R    R<R=R>tUnknownR*R?R@RARBthasattrRR4RR8t_argtlentrange(RRCRDt processnamestprocessnumberstcreatorst
partitionstusedRGtptproctaeobj_0tresultR8ti((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt    processes¨sL    =!  
 9:!  
 
    t_processcBseZRS((t__name__t
__module__(((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR]×scCs:tƒ}d}x$|D]\}}||krdSqWdS(s&Check of processname is active. MacOS9ii(R\(t processnametalltoktntc((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pytisactiveprocessÚs      cCsÐtƒ}|dkr*d |_d |_n$t|dƒ|_t|dƒ|_t|dƒ|_t|dƒ|_t|dƒ|_t|dƒ|_t|dƒ|_    t|d    ƒ|_
t|d
ƒ|_ |S( sRReturn an object with all process properties as attributes for processname. MacOS9RtappttpusdtpvistpisfRtastyRLtrevtthscrN( R]R*t    partitionRVt_processpropertytvisiblet    frontmostRtfiletypet creatortypetaccepthighlevelt hasscripting(R`RW((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt processinfoãs          c    CsÜtƒ}i}i}tjdtjdƒddd|dd ƒ}tjdtjdƒdddtj|ƒd|ƒ}||d<|jd    d
||ƒ\}}}d |krÄttj|ƒ‚nd|krØ|dSd S( s9return the partition size and memory used for processnameR0RIR2tnameR4R5R6s----R9RHR;N(    R    R<R=R>R*R?R@RARB(R`tpropertyRRCRDRERFRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyRnös    -6
!  c        Cs¼tƒ}tjj|ƒ}|jƒ}i}i}d}d}tjdtjdƒddd|dd ƒ}||d    <|j    ||||ƒ\}}}d
|kr¸t
t j |ƒ‚nd S( sBOpen a Finder window for object, Specify object by name or fsspec.taevttodocR0tcfolR2R3R4R5s----R;N( R    R
R R#R$R<R=R>R*R?R@RARB(    R-RR/RCRDt_codet_subcodeRYRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt
openwindows     -
! c        Cs¼tƒ}tjj|ƒ}|jƒ}i}i}d}d}tjdtjdƒddd|dd ƒ}||d    <|j    ||||ƒ\}}}d
|kr¸t
t j |ƒ‚nd S( s2Close a Finder window for folder, Specify by path.R9tclosR0RzR2R3R4R5s----R;N( R    R
R R#R$R<R=R>R*R?R@RARB(    R-RR/RCRDR{R|RYRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt closewindows     -
! cCs;tjj|ƒ}|jƒ}|s.t|ƒSt||ƒS(s§Set the position of a Finder window for folder to pos=(w, h). Specify file by name or fsspec.
    If pos=None, location will return the current position of the object.(R
R R#R$t _getlocationt _setlocation(R-tposR/((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pytlocation&s
 
c
   Csê|\}}tƒ}i}i}tjdtjdƒddd|ddƒ}tjdtjdƒdddtjdƒd|ƒ}||d    <||g|d
<|jd d ||ƒ\}    }}d |kràttj|ƒ‚n||fS(s:_setlocation: Set the location of the icon for the object.R0RzR2R3R4R5R6tposns----R8R9R:R;N(    R    R<R=R>R*R?R@RARB(
R/t.1txtyRRCRDRERFRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR/s        -6
! c    Csîtƒ}i}i}tjdtjdƒddd|dd ƒ}tjdtjdƒdddtjdƒd|ƒ}||d    <|jd
d ||ƒ\}}}d |krÄttj|ƒ‚nd    |krê|d    }|j    |j
fSd S(s:_getlocation: get the location of the icon for the object.R0RzR2R3R4R5R6R„s----R9RHR;N( R    R<R=R>R*R?R@RARBthtv(R/RRCRDRERFRGR‚((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR€=s    -6
!  
cCsbtjj|ƒ}|jƒ}|dkr4t|ƒS|dksL|dkrUd}nt||ƒS(sHlabel: set or get the label of the item. Specify file by name or fsspec.iiN(R
R R#R$R*t    _getlabelt    _setlabel(R-tindexR/((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pytlabelLs  
    c    CsÜtƒ}i}i}tjdtjdƒddd|dd ƒ}tjdtjdƒdddtjdƒd|ƒ}||d    <|jd
d ||ƒ\}}}d |krÄttj|ƒ‚nd    |krØ|d    Sd S(s$label: Get the label for the object.R0R1R2R3R4R5R6tlabis----R9RHR;N(    R    R<R=R>R*R?R@RARB(R/RRCRDRERFRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyRŠVs    -6
!  c
   CsÞtƒ}i}i}d}d}tjdtjdƒddd|dd ƒ}tjdtjdƒdddtjd    ƒd|ƒ}||d
<||d <|j||||ƒ\}    }}d |krÚttj|ƒ‚n|S(s$label: Set the label for the object.R9R:R0R6R2R3R4R5RŽs----R8R;N(    R    R<R=R>R*R?R@RARB(
R/RŒRRCRDR{R|RYtaeobj_1RG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR‹ds    
 
! cCsAtjj|ƒ}|jƒ}|dkr4t|ƒSt||ƒS(s—windowview: Set the view of the window for the folder. Specify file by name or fsspec.
    0 = by icon (default)
    1 = by name
    2 = by button
    N(R
R R#R$R*t_getwindowviewt_setwindowview(tfoldertviewR&t folder_alias((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt
windowviewvs
 
ic    Cs i}i}|dkr*tjdƒ}n-|dkrHtjdƒ}ntjdƒ}tƒ}tjdtjdƒdd    d
|d dƒ}tjdtjd ƒdd d
tjd ƒd |ƒ}tjdtjd ƒdd d
tjdƒd |ƒ}tjdtjd ƒdd d
|d dƒ}    d}
d} ||d<|    |d<|j|
| ||ƒ\} }}d|krˆttj|ƒ‚nd|krœ|dSdS(sset the windowviewitpnamitlgbutiimgR0RzR2R3R4R5R6tcwndtpvewR9R:s----R8R;N(    R<R>R    R=R*R?R@RARB( R”R“RDRCt_vRRYRtaeobj_2taeobj_3R{R|RG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR‘‚s2      
 
!  c        Cs@i}i}tƒ}i}i}tjdtjdƒddd|ddƒ}tjdtjdƒdddtjdƒd|ƒ}tjdtjdƒdddtjd    ƒd|ƒ}||d
<|jd d ||ƒ\}}}d |krttj|ƒ‚nidd6dd6dd6}d
|kr<||d
j    SdS(sget the windowviewR0RzR2R3R4R5R6R™Ršs----R9RHR;iR˜iR–iR—N(
R    R<R=R>R*R?R@RARBtenum(    R”RDRCRRERFtaeobj_02RGtviews((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyRŸs    -66
!  cCsEtjj|ƒ}|jƒ}t|ƒ|s8t|ƒSt||ƒS(s½Set the size of a Finder window for folder to size=(w, h), Specify by path.
    If size=None, windowsize will return the current size of the window.
    Specify file by name or fsspec.
    (R
R R#R$R}t_getwindowsizet_setwindowsize(R’tsizeR&R”((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt
windowsize±s  
 
c    Cs2|\}}tƒ}i}i}d}d}||g}    tjdtjdƒddd|ddƒ}
tjdtjd    ƒdd    dtjd
ƒd|
ƒ} tjdtjd    ƒdd    dtjd ƒd| ƒ} | |d <|    |d <|j||||ƒ\} }}d|kr(ttj|ƒ‚n||fS(s4Set the size of a Finder window for folder to (w, h)R9R:R0RzR2R3R4R5R6R™tptszs----R8R;N(    R    R<R=R>R*R?R@RARB(R”R…twRˆRRCRDR{R|taevar00RYRRœRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR¢½s&         
 
! c    Cstƒ}i}i}tjdtjdƒddd|ddƒ}tjdtjdƒdddtjdƒd|ƒ}tjdtjdƒdddtjd    ƒd|ƒ}||d
<|jd d ||ƒ\}}}d |krúttj|ƒ‚nd
|kr|d
SdS(s4Set the size of a Finder window for folder to (w, h)R0RzR2R3R4R5R6R™R„s----R9RHR;N(    R    R<R=R>R*R?R@RARB(R”RRCRDRYRRœRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR¡Òs    
!  cCsltjj|ƒ}|jƒ}t|ƒ|s8t|ƒSt|ƒtkr_|j|j    f}nt
||ƒS(s=Set the position of a Finder window for folder to pos=(w, h).( R
R R#R$R}t_getwindowpositionRt InstanceTypeRˆR‰t_setwindowposition(R’R‚R&R”((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pytwindowpositionäs 
 
c    Cs.|\}}tƒ}i}i}tjdtjdƒddd|ddƒ}tjdtjdƒdddtjdƒd|ƒ}tjdtjdƒdddtjd    ƒd|ƒ}    |    |d
<||g|d <|jd d ||ƒ\}
}}d|krttj|ƒ‚nd
|kr*|d
SdS(s5Set the size of a Finder window for folder to (w, h).R0RzR2R3R4R5R6R™R„s----R8R9R:R;N(    R    R<R=R>R*R?R@RARB( R”R…R†R‡RRCRDRYRRœRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyRªðs"        
!  c    Cstƒ}i}i}tjdtjdƒddd|ddƒ}tjdtjdƒdddtjdƒd|ƒ}tjdtjdƒdddtjd    ƒd|ƒ}||d
<|jd d ||ƒ\}}}d |krúttj|ƒ‚nd
|kr|d
SdS(s<Get the size of a Finder window for folder, Specify by path.R0RzR2R3R4R5R6R™R¥s----R9RHR;N(    R    R<R=R>R*R?R@RARB(R”RRCRDRYRRœRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR¨s    
!  cCsAtjj|ƒ}|jƒ}|dkr4t|ƒSt||ƒS(s
icon sets the icon of object, if no icondata is given,
    icon will return an AE object with binary data for the current icon.
    If left untouched, this data can be used to paste the icon on another file.
    Development opportunity: get and set the data as PICT.N(R
R R#R$R*t_geticont_seticon(R-ticondataR&R/((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyticons
 
c    CsÜtƒ}i}i}tjdtjdƒddd|dd ƒ}tjdtjdƒdddtjdƒd|ƒ}||d    <|jd
d ||ƒ\}}}d |krÄttj|ƒ‚nd    |krØ|d    Sd S(s6get the icondata for object. Binary data of some sort.R0R1R2R3R4R5R6R˜s----R9RHR;N(    R    R<R=R>R*R?R@RARB(R/RRCRDRERFRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR¬ s    
!  c    Csétƒ}i}i}tjdtjdƒddd|ddƒ}tjdtjdƒdddtjdƒd|ƒ}||d    <||d
<|jd d ||ƒ\}}}d |krÎttj|ƒ‚nd    |krå|d    j    SdS(s@set the icondata for object, formatted as produced by _geticon()R0R1R2R3R4R5R6R˜s----R8R9R:R;N(
R    R<R=R>R*R?R@RARBR8(R/R®RRCRDRERFRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR­0s    
 
!  cCs²tƒ}i}i}|r(||d<n|r;||d<n|rN||d<n||d<|jdd||ƒ\}}}d|kršttj|ƒ‚nd|kr®|dSdS(    sómount a volume, local or on a server on AppleTalk.
    Note: mounting a ASIP server requires a different operation.
    server is the name of the server where the volume belongs
    username, password belong to a registered user of the volume.tPASStUSERtSRVRs----RxtmvolR;N(R    R?R@RARB(tvolumetservertusernametpasswordRRCRDRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt mountvolumeEs       
!  cCst|ƒdS(s&unmount a volume that's on the desktopN(tputaway(R´((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt unmountvolumeZsc    Cs tƒ}i}i}tjdtjdƒddd|dd ƒ|d<tjdd    ||ƒ\}}}d
|krˆttj    |ƒ‚nd|krœ|dSd S( s-puth the object away, whereever it came from.R0tcdisR2RvR4R5s----tfndrtptwyR;N(
R    R<R=R>R*ttalkerR?R@RARB(R-RRCRDRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyR¹^s    1!  cCs£tƒ}i}i}|dkr*d}n|dkr?d}n||d<|jdd||ƒ\}}}d|kr‹ttj|ƒ‚nd|krŸ|dSdS(sKset the audio output level, parameter between 0 (silent) and 7 (full blast)iis----RxtstvlR;N(R    R?R@RARB(tlevelRRCRDRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt volumelevelos              
!  c    Cs¯tƒ}i}i}tjdtjdƒdddtjdƒdd ƒ}||d<|jdd    ||ƒ\}}}d
|kr—ttj|ƒ‚nd|kr«|dSd S( s)return the version of the system softwareR0R6R2R4tver2R5s----R9RHR;N(    R    R<R=R>R*R?R@RARB(RRCRDRERG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt    OSversions    6
!  c    Csyd}tƒ}i}i}tjdtjdƒdddtjdƒddƒ|d<|jd    d
||ƒ\}}}d |kr—ttj|ƒ‚nd|krÅ|dd kr¼d}qÅd }ni}i}tjdtjdƒdddtjdƒddƒ|d<|jd    d
||ƒ\}}}d |krMttj|ƒ‚nd|kru|dd krud }qun|S(sÑreturn the current status of filesharing and whether it is starting up or not:
        -1  file sharing is off and not starting up
        0   file sharing is off and starting up
        1   file sharing is oniÿÿÿÿR0R6R2R4tfshrR5s----R9RHR;iitfsupN(    R    R<R=R>R*R?R@RARB(tstatusRRCRDRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt filesharingŒs,    :!          :!   cCsEtjj|ƒ}tjj|jƒdddƒ}t||ƒdS(smove the object to the trashittrshN(R
R R tFoldert FSFindFoldertas_tupleR(tpathRt trashfolder((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt movetotrash«s"c    Cs˜tƒ}i}i}tjdtjdƒdddtjdƒdd ƒ|d<|jdd    ||ƒ\}}}d
|kr”tjtj|ƒ‚nd S( sempty the trashR0R6R2R4RÈR5s----R¼temptR;N(    R    R<R=R>R*R?RAR@RB(RRCRDRG((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt
emptytrash±s    :! cCsVddl}dGHdGH|jdƒ}|r]t|ƒ}|rIdG|GHndGtjjƒndGH|jdƒ}|r©t|ƒ}|r•dG|GHndGtjjƒnd    GH|jd
ƒ}|r|jd ƒ}|rt||ƒ}|rùd G|GHndGtjjƒqnd GH|jdƒ}|rw|jd ƒ}|rwt    ||ƒ}|r`d G|GHndGtjjƒqwndGH|j
dƒdkrÀt ƒ}|r¬d G|GHndGtjjƒndGH|j
dƒdkr    t ƒ}|rõd G|GHndGtjjƒndGH|j
dƒdkrRt ƒ}|r>d G|GHndGtjjƒndS(Niÿÿÿÿs*Original findertools functionality test...sTesting launch...sFile to launch:sResult: s Press return-sTesting print...sFile to print:sTesting copy...s File to copy:s Destination:sResult:sTesting move...s File to move:sTesting sleep...sSleep?isTesting shutdown...s
Shut down?sTesting restart...sRestart?(t EasyDialogstAskFileForOpenRtsyststdintreadlineRt    AskFolderRRtAskYesNoCancelRR!R"(RÑtpathnameRZtdestdir((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt_test¼sv                      c    CsýdtGHddl}ddl}dGtƒGHdGtƒGHdGHx+tddƒD]}t|ƒtjƒqNWt    dd    ƒd}t
|ƒt |ƒ|j j |ƒ\}}t|ƒt|ƒt|d
ƒt|d ƒd Gt|ƒGHd GHt|dƒt|dƒx?tdƒD]1}t||jddƒ|jddƒfƒqWt|dƒt|d
ƒt|ƒ}dGHxFtdƒD]8}d|dd|df}t||ƒdG|GHqWt||ƒdG|GdGHdGt|ƒGHd}t||ƒdS(Ns.
morefindertools version %s
Tests coming up...iÿÿÿÿs    filesharing on?s    OS versions    System beep volumeiis@findertoolstestR¦iis    labelsRandom locations for an iconiXi2i
iNiÈisAnimated window locationids    window positionsPut a comment in filet:s    sThis is a comment no one reads!(iXiX(iÈi(t __version__tostrandomRÇRÃRQRÁtMacOStSysBeepR R%R(RÌtsplitRR}R•RR¤RƒtrandintR«R.(    RÝRÞR[tftbaseRtorgposR‚R((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt_test2ùsJ        
 
 
 
 
    /       cCs£dGHtƒ}dGHx|D]}dG|GHqWdGHt|ddƒ}dG|ddGHdG|jGHdG|jGHdG|jGHd    G|jGHd
G|jGHd G|jGHdS( Ns#MacOS9 or better specific functionss*Return a list of current active processes:s    s,Attributes of the first process in the list:is        memory partitions        memory useds        is visibles        is frontmosts        has scriptings        accepts high level events(R\RuRmRVRoRpRtRs(tprRWtpinfo((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt_test3-s           t__main__((Dt__doc__twarningsRRR
RRARßRÓt Carbon.Filet Carbon.FolderR<ttypesRÜR@R*RR    RRRRRR!R"R%R(R)R.R,R+R\R]ReRuRnR}RRƒRR€RRŠR‹R•R‘RR¤R¢R¡R«RªR¨R¯R¬R­R¸RºR¹RÁRÃRÇRÎRÐRÚRæRéR^(((s\/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/plat-mac/findertools.pyt<module>sˆ       
                                    
                           /                                    
                                                                    =    4