ยปCore Development>Code coverage>Lib/plat-mac/lib-scriptpackages/Finder/Finder_items.py

Python code coverage for Lib/plat-mac/lib-scriptpackages/Finder/Finder_items.py

#countcontent
1n/a"""Suite Finder items: Commands used with file system items, and basic item definition
2n/aLevel 1, version 1
3n/a
4n/aGenerated from /System/Library/CoreServices/Finder.app
5n/aAETE/AEUT resource version 0/144, language 0, script 0
6n/a"""
7n/a
8n/aimport aetools
9n/aimport MacOS
10n/a
11n/a_code = 'fndr'
12n/a
13n/aclass Finder_items_Events:
14n/a
15n/a def add_to_favorites(self, _object, _attributes={}, **_arguments):
16n/a """add to favorites: (NOT AVAILABLE YET) Add the items to the user\xd5s Favorites
17n/a Required argument: the items to add to the collection of Favorites
18n/a Keyword argument _attributes: AppleEvent attribute dictionary
19n/a """
20n/a _code = 'fndr'
21n/a _subcode = 'ffav'
22n/a
23n/a if _arguments: raise TypeError, 'No optional args expected'
24n/a _arguments['----'] = _object
25n/a
26n/a
27n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
28n/a _arguments, _attributes)
29n/a if _arguments.get('errn', 0):
30n/a raise aetools.Error, aetools.decodeerror(_arguments)
31n/a # XXXX Optionally decode result
32n/a if _arguments.has_key('----'):
33n/a return _arguments['----']
34n/a
35n/a _argmap_clean_up = {
36n/a 'by' : 'by ',
37n/a }
38n/a
39n/a def clean_up(self, _object, _attributes={}, **_arguments):
40n/a """clean up: (NOT AVAILABLE YET) Arrange items in window nicely (only applies to open windows in icon view that are not kept arranged)
41n/a Required argument: the window to clean up
42n/a Keyword argument by: the order in which to clean up the objects (name, index, date, etc.)
43n/a Keyword argument _attributes: AppleEvent attribute dictionary
44n/a """
45n/a _code = 'fndr'
46n/a _subcode = 'fclu'
47n/a
48n/a aetools.keysubst(_arguments, self._argmap_clean_up)
49n/a _arguments['----'] = _object
50n/a
51n/a
52n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
53n/a _arguments, _attributes)
54n/a if _arguments.get('errn', 0):
55n/a raise aetools.Error, aetools.decodeerror(_arguments)
56n/a # XXXX Optionally decode result
57n/a if _arguments.has_key('----'):
58n/a return _arguments['----']
59n/a
60n/a def eject(self, _object=None, _attributes={}, **_arguments):
61n/a """eject: Eject the specified disk(s)
62n/a Required argument: the disk(s) to eject
63n/a Keyword argument _attributes: AppleEvent attribute dictionary
64n/a """
65n/a _code = 'fndr'
66n/a _subcode = 'ejct'
67n/a
68n/a if _arguments: raise TypeError, 'No optional args expected'
69n/a _arguments['----'] = _object
70n/a
71n/a
72n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
73n/a _arguments, _attributes)
74n/a if _arguments.get('errn', 0):
75n/a raise aetools.Error, aetools.decodeerror(_arguments)
76n/a # XXXX Optionally decode result
77n/a if _arguments.has_key('----'):
78n/a return _arguments['----']
79n/a
80n/a def empty(self, _object=None, _attributes={}, **_arguments):
81n/a """empty: Empty the trash
82n/a Required argument: \xd2empty\xd3 and \xd2empty trash\xd3 both do the same thing
83n/a Keyword argument _attributes: AppleEvent attribute dictionary
84n/a """
85n/a _code = 'fndr'
86n/a _subcode = 'empt'
87n/a
88n/a if _arguments: raise TypeError, 'No optional args expected'
89n/a _arguments['----'] = _object
90n/a
91n/a
92n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
93n/a _arguments, _attributes)
94n/a if _arguments.get('errn', 0):
95n/a raise aetools.Error, aetools.decodeerror(_arguments)
96n/a # XXXX Optionally decode result
97n/a if _arguments.has_key('----'):
98n/a return _arguments['----']
99n/a
100n/a def erase(self, _object, _attributes={}, **_arguments):
101n/a """erase: (NOT AVAILABLE) Erase the specified disk(s)
102n/a Required argument: the items to erase
103n/a Keyword argument _attributes: AppleEvent attribute dictionary
104n/a """
105n/a _code = 'fndr'
106n/a _subcode = 'fera'
107n/a
108n/a if _arguments: raise TypeError, 'No optional args expected'
109n/a _arguments['----'] = _object
110n/a
111n/a
112n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
113n/a _arguments, _attributes)
114n/a if _arguments.get('errn', 0):
115n/a raise aetools.Error, aetools.decodeerror(_arguments)
116n/a # XXXX Optionally decode result
117n/a if _arguments.has_key('----'):
118n/a return _arguments['----']
119n/a
120n/a def reveal(self, _object, _attributes={}, **_arguments):
121n/a """reveal: Bring the specified object(s) into view
122n/a Required argument: the object to be made visible
123n/a Keyword argument _attributes: AppleEvent attribute dictionary
124n/a """
125n/a _code = 'misc'
126n/a _subcode = 'mvis'
127n/a
128n/a if _arguments: raise TypeError, 'No optional args expected'
129n/a _arguments['----'] = _object
130n/a
131n/a
132n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
133n/a _arguments, _attributes)
134n/a if _arguments.get('errn', 0):
135n/a raise aetools.Error, aetools.decodeerror(_arguments)
136n/a # XXXX Optionally decode result
137n/a if _arguments.has_key('----'):
138n/a return _arguments['----']
139n/a
140n/a _argmap_update = {
141n/a 'necessity' : 'nec?',
142n/a 'registering_applications' : 'reg?',
143n/a }
144n/a
145n/a def update(self, _object, _attributes={}, **_arguments):
146n/a """update: Update the display of the specified object(s) to match their on-disk representation
147n/a Required argument: the item to update
148n/a Keyword argument necessity: only update if necessary (i.e. a finder window is open). default is false
149n/a Keyword argument registering_applications: register applications. default is true
150n/a Keyword argument _attributes: AppleEvent attribute dictionary
151n/a """
152n/a _code = 'fndr'
153n/a _subcode = 'fupd'
154n/a
155n/a aetools.keysubst(_arguments, self._argmap_update)
156n/a _arguments['----'] = _object
157n/a
158n/a
159n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
160n/a _arguments, _attributes)
161n/a if _arguments.get('errn', 0):
162n/a raise aetools.Error, aetools.decodeerror(_arguments)
163n/a # XXXX Optionally decode result
164n/a if _arguments.has_key('----'):
165n/a return _arguments['----']
166n/a
167n/a
168n/aclass item(aetools.ComponentItem):
169n/a """item - An item """
170n/a want = 'cobj'
171n/aclass _Prop_bounds(aetools.NProperty):
172n/a """bounds - the bounding rectangle of the item (can only be set for an item in a window viewed as icons or buttons) """
173n/a which = 'pbnd'
174n/a want = 'qdrt'
175n/aclass _Prop_comment(aetools.NProperty):
176n/a """comment - the comment of the item, displayed in the \xd2Get Info\xd3 window """
177n/a which = 'comt'
178n/a want = 'utxt'
179n/aclass _Prop_container(aetools.NProperty):
180n/a """container - the container of the item """
181n/a which = 'ctnr'
182n/a want = 'obj '
183n/aclass _Prop_creation_date(aetools.NProperty):
184n/a """creation date - the date on which the item was created """
185n/a which = 'ascd'
186n/a want = 'ldt '
187n/aclass _Prop_description(aetools.NProperty):
188n/a """description - a description of the item """
189n/a which = 'dscr'
190n/a want = 'utxt'
191n/aclass _Prop_disk(aetools.NProperty):
192n/a """disk - the disk on which the item is stored """
193n/a which = 'cdis'
194n/a want = 'obj '
195n/aclass _Prop_displayed_name(aetools.NProperty):
196n/a """displayed name - the user-visible name of the item """
197n/a which = 'dnam'
198n/a want = 'utxt'
199n/aclass _Prop_everyones_privileges(aetools.NProperty):
200n/a """everyones privileges - """
201n/a which = 'gstp'
202n/a want = 'priv'
203n/aclass _Prop_extension_hidden(aetools.NProperty):
204n/a """extension hidden - Is the item's extension hidden from the user? """
205n/a which = 'hidx'
206n/a want = 'bool'
207n/aclass _Prop_group(aetools.NProperty):
208n/a """group - the user or group that has special access to the container """
209n/a which = 'sgrp'
210n/a want = 'utxt'
211n/aclass _Prop_group_privileges(aetools.NProperty):
212n/a """group privileges - """
213n/a which = 'gppr'
214n/a want = 'priv'
215n/aclass _Prop_icon(aetools.NProperty):
216n/a """icon - the icon bitmap of the item """
217n/a which = 'iimg'
218n/a want = 'ifam'
219n/aclass _Prop_index(aetools.NProperty):
220n/a """index - the index in the front-to-back ordering within its container """
221n/a which = 'pidx'
222n/a want = 'long'
223n/aclass _Prop_information_window(aetools.NProperty):
224n/a """information window - the information window for the item """
225n/a which = 'iwnd'
226n/a want = 'obj '
227n/aclass _Prop_kind(aetools.NProperty):
228n/a """kind - the kind of the item """
229n/a which = 'kind'
230n/a want = 'utxt'
231n/aclass _Prop_label_index(aetools.NProperty):
232n/a """label index - the label of the item """
233n/a which = 'labi'
234n/a want = 'long'
235n/aclass _Prop_locked(aetools.NProperty):
236n/a """locked - Is the file locked? """
237n/a which = 'aslk'
238n/a want = 'bool'
239n/aclass _Prop_modification_date(aetools.NProperty):
240n/a """modification date - the date on which the item was last modified """
241n/a which = 'asmo'
242n/a want = 'ldt '
243n/aclass _Prop_name(aetools.NProperty):
244n/a """name - the name of the item """
245n/a which = 'pnam'
246n/a want = 'utxt'
247n/aclass _Prop_name_extension(aetools.NProperty):
248n/a """name extension - the name extension of the item (such as \xd2txt\xd3) """
249n/a which = 'nmxt'
250n/a want = 'utxt'
251n/aclass _Prop_owner(aetools.NProperty):
252n/a """owner - the user that owns the container """
253n/a which = 'sown'
254n/a want = 'utxt'
255n/aclass _Prop_owner_privileges(aetools.NProperty):
256n/a """owner privileges - """
257n/a which = 'ownr'
258n/a want = 'priv'
259n/aclass _Prop_physical_size(aetools.NProperty):
260n/a """physical size - the actual space used by the item on disk """
261n/a which = 'phys'
262n/a want = 'comp'
263n/aclass _Prop_position(aetools.NProperty):
264n/a """position - the position of the item within its parent window (can only be set for an item in a window viewed as icons or buttons) """
265n/a which = 'posn'
266n/a want = 'QDpt'
267n/aclass _Prop_properties(aetools.NProperty):
268n/a """properties - every property of an item """
269n/a which = 'pALL'
270n/a want = 'reco'
271n/aclass _Prop_size(aetools.NProperty):
272n/a """size - the logical size of the item """
273n/a which = 'ptsz'
274n/a want = 'comp'
275n/aclass _Prop_url(aetools.NProperty):
276n/a """url - the url of the item """
277n/a which = 'pURL'
278n/a want = 'utxt'
279n/a
280n/aitems = item
281n/aitem._superclassnames = []
282n/aitem._privpropdict = {
283n/a 'bounds' : _Prop_bounds,
284n/a 'comment' : _Prop_comment,
285n/a 'container' : _Prop_container,
286n/a 'creation_date' : _Prop_creation_date,
287n/a 'description' : _Prop_description,
288n/a 'disk' : _Prop_disk,
289n/a 'displayed_name' : _Prop_displayed_name,
290n/a 'everyones_privileges' : _Prop_everyones_privileges,
291n/a 'extension_hidden' : _Prop_extension_hidden,
292n/a 'group' : _Prop_group,
293n/a 'group_privileges' : _Prop_group_privileges,
294n/a 'icon' : _Prop_icon,
295n/a 'index' : _Prop_index,
296n/a 'information_window' : _Prop_information_window,
297n/a 'kind' : _Prop_kind,
298n/a 'label_index' : _Prop_label_index,
299n/a 'locked' : _Prop_locked,
300n/a 'modification_date' : _Prop_modification_date,
301n/a 'name' : _Prop_name,
302n/a 'name_extension' : _Prop_name_extension,
303n/a 'owner' : _Prop_owner,
304n/a 'owner_privileges' : _Prop_owner_privileges,
305n/a 'physical_size' : _Prop_physical_size,
306n/a 'position' : _Prop_position,
307n/a 'properties' : _Prop_properties,
308n/a 'size' : _Prop_size,
309n/a 'url' : _Prop_url,
310n/a}
311n/aitem._privelemdict = {
312n/a}
313n/a
314n/a#
315n/a# Indices of types declared in this module
316n/a#
317n/a_classdeclarations = {
318n/a 'cobj' : item,
319n/a}
320n/a
321n/a_propdeclarations = {
322n/a 'ascd' : _Prop_creation_date,
323n/a 'aslk' : _Prop_locked,
324n/a 'asmo' : _Prop_modification_date,
325n/a 'cdis' : _Prop_disk,
326n/a 'comt' : _Prop_comment,
327n/a 'ctnr' : _Prop_container,
328n/a 'dnam' : _Prop_displayed_name,
329n/a 'dscr' : _Prop_description,
330n/a 'gppr' : _Prop_group_privileges,
331n/a 'gstp' : _Prop_everyones_privileges,
332n/a 'hidx' : _Prop_extension_hidden,
333n/a 'iimg' : _Prop_icon,
334n/a 'iwnd' : _Prop_information_window,
335n/a 'kind' : _Prop_kind,
336n/a 'labi' : _Prop_label_index,
337n/a 'nmxt' : _Prop_name_extension,
338n/a 'ownr' : _Prop_owner_privileges,
339n/a 'pALL' : _Prop_properties,
340n/a 'pURL' : _Prop_url,
341n/a 'pbnd' : _Prop_bounds,
342n/a 'phys' : _Prop_physical_size,
343n/a 'pidx' : _Prop_index,
344n/a 'pnam' : _Prop_name,
345n/a 'posn' : _Prop_position,
346n/a 'ptsz' : _Prop_size,
347n/a 'sgrp' : _Prop_group,
348n/a 'sown' : _Prop_owner,
349n/a}
350n/a
351n/a_compdeclarations = {
352n/a}
353n/a
354n/a_enumdeclarations = {
355n/a}