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

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

#countcontent
1n/a"""Suite Standard Suite: Common terms that most applications should support
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 = 'CoRe'
12n/a
13n/afrom StdSuites.Standard_Suite import *
14n/aclass Standard_Suite_Events(Standard_Suite_Events):
15n/a
16n/a def close(self, _object, _attributes={}, **_arguments):
17n/a """close: Close an object
18n/a Required argument: the object to close
19n/a Keyword argument _attributes: AppleEvent attribute dictionary
20n/a """
21n/a _code = 'core'
22n/a _subcode = 'clos'
23n/a
24n/a if _arguments: raise TypeError, 'No optional args expected'
25n/a _arguments['----'] = _object
26n/a
27n/a
28n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
29n/a _arguments, _attributes)
30n/a if _arguments.get('errn', 0):
31n/a raise aetools.Error, aetools.decodeerror(_arguments)
32n/a # XXXX Optionally decode result
33n/a if _arguments.has_key('----'):
34n/a return _arguments['----']
35n/a
36n/a _argmap_count = {
37n/a 'each' : 'kocl',
38n/a }
39n/a
40n/a def count(self, _object, _attributes={}, **_arguments):
41n/a """count: Return the number of elements of a particular class within an object
42n/a Required argument: the object whose elements are to be counted
43n/a Keyword argument each: the class of the elements to be counted
44n/a Keyword argument _attributes: AppleEvent attribute dictionary
45n/a Returns: the number of elements
46n/a """
47n/a _code = 'core'
48n/a _subcode = 'cnte'
49n/a
50n/a aetools.keysubst(_arguments, self._argmap_count)
51n/a _arguments['----'] = _object
52n/a
53n/a
54n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
55n/a _arguments, _attributes)
56n/a if _arguments.get('errn', 0):
57n/a raise aetools.Error, aetools.decodeerror(_arguments)
58n/a # XXXX Optionally decode result
59n/a if _arguments.has_key('----'):
60n/a return _arguments['----']
61n/a
62n/a _argmap_data_size = {
63n/a 'as' : 'rtyp',
64n/a }
65n/a
66n/a def data_size(self, _object, _attributes={}, **_arguments):
67n/a """data size: Return the size in bytes of an object
68n/a Required argument: the object whose data size is to be returned
69n/a Keyword argument as: the data type for which the size is calculated
70n/a Keyword argument _attributes: AppleEvent attribute dictionary
71n/a Returns: the size of the object in bytes
72n/a """
73n/a _code = 'core'
74n/a _subcode = 'dsiz'
75n/a
76n/a aetools.keysubst(_arguments, self._argmap_data_size)
77n/a _arguments['----'] = _object
78n/a
79n/a
80n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
81n/a _arguments, _attributes)
82n/a if _arguments.get('errn', 0):
83n/a raise aetools.Error, aetools.decodeerror(_arguments)
84n/a # XXXX Optionally decode result
85n/a if _arguments.has_key('----'):
86n/a return _arguments['----']
87n/a
88n/a def delete(self, _object, _attributes={}, **_arguments):
89n/a """delete: Move an item from its container to the trash
90n/a Required argument: the item to delete
91n/a Keyword argument _attributes: AppleEvent attribute dictionary
92n/a Returns: to the item that was just deleted
93n/a """
94n/a _code = 'core'
95n/a _subcode = 'delo'
96n/a
97n/a if _arguments: raise TypeError, 'No optional args expected'
98n/a _arguments['----'] = _object
99n/a
100n/a
101n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
102n/a _arguments, _attributes)
103n/a if _arguments.get('errn', 0):
104n/a raise aetools.Error, aetools.decodeerror(_arguments)
105n/a # XXXX Optionally decode result
106n/a if _arguments.has_key('----'):
107n/a return _arguments['----']
108n/a
109n/a _argmap_duplicate = {
110n/a 'to' : 'insh',
111n/a 'replacing' : 'alrp',
112n/a 'routing_suppressed' : 'rout',
113n/a }
114n/a
115n/a def duplicate(self, _object, _attributes={}, **_arguments):
116n/a """duplicate: Duplicate one or more object(s)
117n/a Required argument: the object(s) to duplicate
118n/a Keyword argument to: the new location for the object(s)
119n/a Keyword argument replacing: Specifies whether or not to replace items in the destination that have the same name as items being duplicated
120n/a Keyword argument routing_suppressed: Specifies whether or not to autoroute items (default is false). Only applies when copying to the system folder.
121n/a Keyword argument _attributes: AppleEvent attribute dictionary
122n/a Returns: to the duplicated object(s)
123n/a """
124n/a _code = 'core'
125n/a _subcode = 'clon'
126n/a
127n/a aetools.keysubst(_arguments, self._argmap_duplicate)
128n/a _arguments['----'] = _object
129n/a
130n/a aetools.enumsubst(_arguments, 'alrp', _Enum_bool)
131n/a aetools.enumsubst(_arguments, 'rout', _Enum_bool)
132n/a
133n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
134n/a _arguments, _attributes)
135n/a if _arguments.get('errn', 0):
136n/a raise aetools.Error, aetools.decodeerror(_arguments)
137n/a # XXXX Optionally decode result
138n/a if _arguments.has_key('----'):
139n/a return _arguments['----']
140n/a
141n/a def exists(self, _object, _attributes={}, **_arguments):
142n/a """exists: Verify if an object exists
143n/a Required argument: the object in question
144n/a Keyword argument _attributes: AppleEvent attribute dictionary
145n/a Returns: true if it exists, false if not
146n/a """
147n/a _code = 'core'
148n/a _subcode = 'doex'
149n/a
150n/a if _arguments: raise TypeError, 'No optional args expected'
151n/a _arguments['----'] = _object
152n/a
153n/a
154n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
155n/a _arguments, _attributes)
156n/a if _arguments.get('errn', 0):
157n/a raise aetools.Error, aetools.decodeerror(_arguments)
158n/a # XXXX Optionally decode result
159n/a if _arguments.has_key('----'):
160n/a return _arguments['----']
161n/a
162n/a _argmap_make = {
163n/a 'new' : 'kocl',
164n/a 'at' : 'insh',
165n/a 'to' : 'to ',
166n/a 'with_properties' : 'prdt',
167n/a }
168n/a
169n/a def make(self, _no_object=None, _attributes={}, **_arguments):
170n/a """make: Make a new element
171n/a Keyword argument new: the class of the new element
172n/a Keyword argument at: the location at which to insert the element
173n/a Keyword argument to: when creating an alias file, the original item to create an alias to or when creating a file viewer window, the target of the window
174n/a Keyword argument with_properties: the initial values for the properties of the element
175n/a Keyword argument _attributes: AppleEvent attribute dictionary
176n/a Returns: to the new object(s)
177n/a """
178n/a _code = 'core'
179n/a _subcode = 'crel'
180n/a
181n/a aetools.keysubst(_arguments, self._argmap_make)
182n/a if _no_object is not None: raise TypeError, 'No direct arg expected'
183n/a
184n/a
185n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
186n/a _arguments, _attributes)
187n/a if _arguments.get('errn', 0):
188n/a raise aetools.Error, aetools.decodeerror(_arguments)
189n/a # XXXX Optionally decode result
190n/a if _arguments.has_key('----'):
191n/a return _arguments['----']
192n/a
193n/a _argmap_move = {
194n/a 'to' : 'insh',
195n/a 'replacing' : 'alrp',
196n/a 'positioned_at' : 'mvpl',
197n/a 'routing_suppressed' : 'rout',
198n/a }
199n/a
200n/a def move(self, _object, _attributes={}, **_arguments):
201n/a """move: Move object(s) to a new location
202n/a Required argument: the object(s) to move
203n/a Keyword argument to: the new location for the object(s)
204n/a Keyword argument replacing: Specifies whether or not to replace items in the destination that have the same name as items being moved
205n/a Keyword argument positioned_at: Gives a list (in local window coordinates) of positions for the destination items
206n/a Keyword argument routing_suppressed: Specifies whether or not to autoroute items (default is false). Only applies when moving to the system folder.
207n/a Keyword argument _attributes: AppleEvent attribute dictionary
208n/a Returns: to the object(s) after they have been moved
209n/a """
210n/a _code = 'core'
211n/a _subcode = 'move'
212n/a
213n/a aetools.keysubst(_arguments, self._argmap_move)
214n/a _arguments['----'] = _object
215n/a
216n/a aetools.enumsubst(_arguments, 'alrp', _Enum_bool)
217n/a aetools.enumsubst(_arguments, 'mvpl', _Enum_list)
218n/a aetools.enumsubst(_arguments, 'rout', _Enum_bool)
219n/a
220n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
221n/a _arguments, _attributes)
222n/a if _arguments.get('errn', 0):
223n/a raise aetools.Error, aetools.decodeerror(_arguments)
224n/a # XXXX Optionally decode result
225n/a if _arguments.has_key('----'):
226n/a return _arguments['----']
227n/a
228n/a _argmap_open = {
229n/a 'using' : 'usin',
230n/a 'with_properties' : 'prdt',
231n/a }
232n/a
233n/a def open(self, _object, _attributes={}, **_arguments):
234n/a """open: Open the specified object(s)
235n/a Required argument: list of objects to open
236n/a Keyword argument using: the application file to open the object with
237n/a Keyword argument with_properties: the initial values for the properties, to be included with the open command sent to the application that opens the direct object
238n/a Keyword argument _attributes: AppleEvent attribute dictionary
239n/a """
240n/a _code = 'aevt'
241n/a _subcode = 'odoc'
242n/a
243n/a aetools.keysubst(_arguments, self._argmap_open)
244n/a _arguments['----'] = _object
245n/a
246n/a
247n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
248n/a _arguments, _attributes)
249n/a if _arguments.get('errn', 0):
250n/a raise aetools.Error, aetools.decodeerror(_arguments)
251n/a # XXXX Optionally decode result
252n/a if _arguments.has_key('----'):
253n/a return _arguments['----']
254n/a
255n/a _argmap_print_ = {
256n/a 'with_properties' : 'prdt',
257n/a }
258n/a
259n/a def print_(self, _object, _attributes={}, **_arguments):
260n/a """print: Print the specified object(s)
261n/a Required argument: list of objects to print
262n/a Keyword argument with_properties: optional properties to be included with the print command sent to the application that prints the direct object
263n/a Keyword argument _attributes: AppleEvent attribute dictionary
264n/a """
265n/a _code = 'aevt'
266n/a _subcode = 'pdoc'
267n/a
268n/a aetools.keysubst(_arguments, self._argmap_print_)
269n/a _arguments['----'] = _object
270n/a
271n/a
272n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
273n/a _arguments, _attributes)
274n/a if _arguments.get('errn', 0):
275n/a raise aetools.Error, aetools.decodeerror(_arguments)
276n/a # XXXX Optionally decode result
277n/a if _arguments.has_key('----'):
278n/a return _arguments['----']
279n/a
280n/a def quit(self, _no_object=None, _attributes={}, **_arguments):
281n/a """quit: Quit the Finder
282n/a Keyword argument _attributes: AppleEvent attribute dictionary
283n/a """
284n/a _code = 'aevt'
285n/a _subcode = 'quit'
286n/a
287n/a if _arguments: raise TypeError, 'No optional args expected'
288n/a if _no_object is not None: raise TypeError, 'No direct arg expected'
289n/a
290n/a
291n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
292n/a _arguments, _attributes)
293n/a if _arguments.get('errn', 0):
294n/a raise aetools.Error, aetools.decodeerror(_arguments)
295n/a # XXXX Optionally decode result
296n/a if _arguments.has_key('----'):
297n/a return _arguments['----']
298n/a
299n/a def select(self, _object, _attributes={}, **_arguments):
300n/a """select: Select the specified object(s)
301n/a Required argument: the object to select
302n/a Keyword argument _attributes: AppleEvent attribute dictionary
303n/a """
304n/a _code = 'misc'
305n/a _subcode = 'slct'
306n/a
307n/a if _arguments: raise TypeError, 'No optional args expected'
308n/a _arguments['----'] = _object
309n/a
310n/a
311n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
312n/a _arguments, _attributes)
313n/a if _arguments.get('errn', 0):
314n/a raise aetools.Error, aetools.decodeerror(_arguments)
315n/a # XXXX Optionally decode result
316n/a if _arguments.has_key('----'):
317n/a return _arguments['----']
318n/a
319n/a_Enum_list = None # XXXX enum list not found!!
320n/a_Enum_bool = None # XXXX enum bool not found!!
321n/a
322n/a#
323n/a# Indices of types declared in this module
324n/a#
325n/a_classdeclarations = {
326n/a}
327n/a
328n/a_propdeclarations = {
329n/a}
330n/a
331n/a_compdeclarations = {
332n/a}
333n/a
334n/a_enumdeclarations = {
335n/a}