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

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

#countcontent
1n/a"""Suite Standard Suite: Common classes and commands for most applications.
2n/aLevel 1, version 1
3n/a
4n/aGenerated from /Applications/Utilities/Terminal.app
5n/aAETE/AEUT resource version 1/0, language 0, script 0
6n/a"""
7n/a
8n/aimport aetools
9n/aimport MacOS
10n/a
11n/a_code = '????'
12n/a
13n/aclass Standard_Suite_Events:
14n/a
15n/a _argmap_close = {
16n/a 'saving_in' : 'kfil',
17n/a 'saving' : 'savo',
18n/a }
19n/a
20n/a def close(self, _object, _attributes={}, **_arguments):
21n/a """close: Close an object.
22n/a Required argument: the object for the command
23n/a Keyword argument saving_in: The file in which to save the object.
24n/a Keyword argument saving: Specifies whether changes should be saved before closing.
25n/a Keyword argument _attributes: AppleEvent attribute dictionary
26n/a """
27n/a _code = 'core'
28n/a _subcode = 'clos'
29n/a
30n/a aetools.keysubst(_arguments, self._argmap_close)
31n/a _arguments['----'] = _object
32n/a
33n/a aetools.enumsubst(_arguments, 'savo', _Enum_savo)
34n/a
35n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
36n/a _arguments, _attributes)
37n/a if _arguments.get('errn', 0):
38n/a raise aetools.Error, aetools.decodeerror(_arguments)
39n/a # XXXX Optionally decode result
40n/a if _arguments.has_key('----'):
41n/a return _arguments['----']
42n/a
43n/a _argmap_count = {
44n/a 'each' : 'kocl',
45n/a }
46n/a
47n/a def count(self, _object, _attributes={}, **_arguments):
48n/a """count: Return the number of elements of a particular class within an object.
49n/a Required argument: the object for the command
50n/a Keyword argument each: The class of objects to be counted.
51n/a Keyword argument _attributes: AppleEvent attribute dictionary
52n/a Returns: the reply for the command
53n/a """
54n/a _code = 'core'
55n/a _subcode = 'cnte'
56n/a
57n/a aetools.keysubst(_arguments, self._argmap_count)
58n/a _arguments['----'] = _object
59n/a
60n/a
61n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
62n/a _arguments, _attributes)
63n/a if _arguments.get('errn', 0):
64n/a raise aetools.Error, aetools.decodeerror(_arguments)
65n/a # XXXX Optionally decode result
66n/a if _arguments.has_key('----'):
67n/a return _arguments['----']
68n/a
69n/a def delete(self, _object, _attributes={}, **_arguments):
70n/a """delete: Delete an object.
71n/a Required argument: the object for the command
72n/a Keyword argument _attributes: AppleEvent attribute dictionary
73n/a """
74n/a _code = 'core'
75n/a _subcode = 'delo'
76n/a
77n/a if _arguments: raise TypeError, 'No optional args expected'
78n/a _arguments['----'] = _object
79n/a
80n/a
81n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
82n/a _arguments, _attributes)
83n/a if _arguments.get('errn', 0):
84n/a raise aetools.Error, aetools.decodeerror(_arguments)
85n/a # XXXX Optionally decode result
86n/a if _arguments.has_key('----'):
87n/a return _arguments['----']
88n/a
89n/a _argmap_duplicate = {
90n/a 'to' : 'insh',
91n/a 'with_properties' : 'prdt',
92n/a }
93n/a
94n/a def duplicate(self, _object, _attributes={}, **_arguments):
95n/a """duplicate: Copy object(s) and put the copies at a new location.
96n/a Required argument: the object for the command
97n/a Keyword argument to: The location for the new object(s).
98n/a Keyword argument with_properties: Properties to be set in the new duplicated object(s).
99n/a Keyword argument _attributes: AppleEvent attribute dictionary
100n/a """
101n/a _code = 'core'
102n/a _subcode = 'clon'
103n/a
104n/a aetools.keysubst(_arguments, self._argmap_duplicate)
105n/a _arguments['----'] = _object
106n/a
107n/a
108n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
109n/a _arguments, _attributes)
110n/a if _arguments.get('errn', 0):
111n/a raise aetools.Error, aetools.decodeerror(_arguments)
112n/a # XXXX Optionally decode result
113n/a if _arguments.has_key('----'):
114n/a return _arguments['----']
115n/a
116n/a def exists(self, _object, _attributes={}, **_arguments):
117n/a """exists: Verify if an object exists.
118n/a Required argument: the object for the command
119n/a Keyword argument _attributes: AppleEvent attribute dictionary
120n/a Returns: the reply for the command
121n/a """
122n/a _code = 'core'
123n/a _subcode = 'doex'
124n/a
125n/a if _arguments: raise TypeError, 'No optional args expected'
126n/a _arguments['----'] = _object
127n/a
128n/a
129n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
130n/a _arguments, _attributes)
131n/a if _arguments.get('errn', 0):
132n/a raise aetools.Error, aetools.decodeerror(_arguments)
133n/a # XXXX Optionally decode result
134n/a if _arguments.has_key('----'):
135n/a return _arguments['----']
136n/a
137n/a def get(self, _object, _attributes={}, **_arguments):
138n/a """get: Get the data for an object.
139n/a Required argument: the object for the command
140n/a Keyword argument _attributes: AppleEvent attribute dictionary
141n/a Returns: the reply for the command
142n/a """
143n/a _code = 'core'
144n/a _subcode = 'getd'
145n/a
146n/a if _arguments: raise TypeError, 'No optional args expected'
147n/a _arguments['----'] = _object
148n/a
149n/a
150n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
151n/a _arguments, _attributes)
152n/a if _arguments.get('errn', 0):
153n/a raise aetools.Error, aetools.decodeerror(_arguments)
154n/a # XXXX Optionally decode result
155n/a if _arguments.has_key('----'):
156n/a return _arguments['----']
157n/a
158n/a _argmap_make = {
159n/a 'at' : 'insh',
160n/a 'new' : 'kocl',
161n/a 'with_data' : 'data',
162n/a 'with_properties' : 'prdt',
163n/a }
164n/a
165n/a def make(self, _no_object=None, _attributes={}, **_arguments):
166n/a """make: Make a new object.
167n/a Keyword argument at: The location at which to insert the object.
168n/a Keyword argument new: The class of the new object.
169n/a Keyword argument with_data: The initial data for the object.
170n/a Keyword argument with_properties: The initial values for properties of the object.
171n/a Keyword argument _attributes: AppleEvent attribute dictionary
172n/a Returns: the reply for the command
173n/a """
174n/a _code = 'core'
175n/a _subcode = 'crel'
176n/a
177n/a aetools.keysubst(_arguments, self._argmap_make)
178n/a if _no_object is not None: raise TypeError, 'No direct arg expected'
179n/a
180n/a
181n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
182n/a _arguments, _attributes)
183n/a if _arguments.get('errn', 0):
184n/a raise aetools.Error, aetools.decodeerror(_arguments)
185n/a # XXXX Optionally decode result
186n/a if _arguments.has_key('----'):
187n/a return _arguments['----']
188n/a
189n/a _argmap_move = {
190n/a 'to' : 'insh',
191n/a }
192n/a
193n/a def move(self, _object, _attributes={}, **_arguments):
194n/a """move: Move object(s) to a new location.
195n/a Required argument: the object for the command
196n/a Keyword argument to: The new location for the object(s).
197n/a Keyword argument _attributes: AppleEvent attribute dictionary
198n/a """
199n/a _code = 'core'
200n/a _subcode = 'move'
201n/a
202n/a aetools.keysubst(_arguments, self._argmap_move)
203n/a _arguments['----'] = _object
204n/a
205n/a
206n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
207n/a _arguments, _attributes)
208n/a if _arguments.get('errn', 0):
209n/a raise aetools.Error, aetools.decodeerror(_arguments)
210n/a # XXXX Optionally decode result
211n/a if _arguments.has_key('----'):
212n/a return _arguments['----']
213n/a
214n/a def open(self, _object=None, _attributes={}, **_arguments):
215n/a """open: Open an object.
216n/a Required argument: list of objects
217n/a Keyword argument _attributes: AppleEvent attribute dictionary
218n/a """
219n/a _code = 'aevt'
220n/a _subcode = 'odoc'
221n/a
222n/a if _arguments: raise TypeError, 'No optional args expected'
223n/a _arguments['----'] = _object
224n/a
225n/a
226n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
227n/a _arguments, _attributes)
228n/a if _arguments.get('errn', 0):
229n/a raise aetools.Error, aetools.decodeerror(_arguments)
230n/a # XXXX Optionally decode result
231n/a if _arguments.has_key('----'):
232n/a return _arguments['----']
233n/a
234n/a def print_(self, _object=None, _attributes={}, **_arguments):
235n/a """print: Print an object.
236n/a Required argument: list of objects
237n/a Keyword argument _attributes: AppleEvent attribute dictionary
238n/a """
239n/a _code = 'aevt'
240n/a _subcode = 'pdoc'
241n/a
242n/a if _arguments: raise TypeError, 'No optional args expected'
243n/a _arguments['----'] = _object
244n/a
245n/a
246n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
247n/a _arguments, _attributes)
248n/a if _arguments.get('errn', 0):
249n/a raise aetools.Error, aetools.decodeerror(_arguments)
250n/a # XXXX Optionally decode result
251n/a if _arguments.has_key('----'):
252n/a return _arguments['----']
253n/a
254n/a _argmap_quit = {
255n/a 'saving' : 'savo',
256n/a }
257n/a
258n/a def quit(self, _object, _attributes={}, **_arguments):
259n/a """quit: Quit an application.
260n/a Required argument: the object for the command
261n/a Keyword argument saving: Specifies whether changes should be saved before quitting.
262n/a Keyword argument _attributes: AppleEvent attribute dictionary
263n/a """
264n/a _code = 'aevt'
265n/a _subcode = 'quit'
266n/a
267n/a aetools.keysubst(_arguments, self._argmap_quit)
268n/a _arguments['----'] = _object
269n/a
270n/a aetools.enumsubst(_arguments, 'savo', _Enum_savo)
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 _argmap_save = {
281n/a 'in_' : 'kfil',
282n/a 'as' : 'fltp',
283n/a }
284n/a
285n/a def save(self, _object, _attributes={}, **_arguments):
286n/a """save: Save an object.
287n/a Required argument: the object for the command
288n/a Keyword argument in_: The file in which to save the object.
289n/a Keyword argument as: The file type in which to save the data.
290n/a Keyword argument _attributes: AppleEvent attribute dictionary
291n/a """
292n/a _code = 'core'
293n/a _subcode = 'save'
294n/a
295n/a aetools.keysubst(_arguments, self._argmap_save)
296n/a _arguments['----'] = _object
297n/a
298n/a
299n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
300n/a _arguments, _attributes)
301n/a if _arguments.get('errn', 0):
302n/a raise aetools.Error, aetools.decodeerror(_arguments)
303n/a # XXXX Optionally decode result
304n/a if _arguments.has_key('----'):
305n/a return _arguments['----']
306n/a
307n/a _argmap_set = {
308n/a 'to' : 'data',
309n/a }
310n/a
311n/a def set(self, _object, _attributes={}, **_arguments):
312n/a """set: Set an object's data.
313n/a Required argument: the object for the command
314n/a Keyword argument to: The new value.
315n/a Keyword argument _attributes: AppleEvent attribute dictionary
316n/a """
317n/a _code = 'core'
318n/a _subcode = 'setd'
319n/a
320n/a aetools.keysubst(_arguments, self._argmap_set)
321n/a _arguments['----'] = _object
322n/a
323n/a
324n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
325n/a _arguments, _attributes)
326n/a if _arguments.get('errn', 0):
327n/a raise aetools.Error, aetools.decodeerror(_arguments)
328n/a # XXXX Optionally decode result
329n/a if _arguments.has_key('----'):
330n/a return _arguments['----']
331n/a
332n/a
333n/aclass application(aetools.ComponentItem):
334n/a """application - An application's top level scripting object. """
335n/a want = 'capp'
336n/aclass _Prop__3c_Inheritance_3e_(aetools.NProperty):
337n/a """<Inheritance> - All of the properties of the superclass. """
338n/a which = 'c@#^'
339n/a want = 'cobj'
340n/a_3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_()
341n/aclass _Prop_frontmost(aetools.NProperty):
342n/a """frontmost - Is this the frontmost (active) application? """
343n/a which = 'pisf'
344n/a want = 'bool'
345n/afrontmost = _Prop_frontmost()
346n/aclass _Prop_name(aetools.NProperty):
347n/a """name - The name of the application. """
348n/a which = 'pnam'
349n/a want = 'utxt'
350n/aname = _Prop_name()
351n/aclass _Prop_version(aetools.NProperty):
352n/a """version - The version of the application. """
353n/a which = 'vers'
354n/a want = 'utxt'
355n/aversion = _Prop_version()
356n/a# element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID ']
357n/a# element 'docu' as ['name', 'indx', 'rele', 'rang', 'test']
358n/a
359n/aapplications = application
360n/a
361n/aclass item(aetools.ComponentItem):
362n/a """item - A scriptable object. """
363n/a want = 'cobj'
364n/aclass _Prop_class_(aetools.NProperty):
365n/a """class - The class of the object. """
366n/a which = 'pcls'
367n/a want = 'type'
368n/aclass _Prop_properties(aetools.NProperty):
369n/a """properties - All of the object's properties. """
370n/a which = 'pALL'
371n/a want = 'reco'
372n/a
373n/aitems = item
374n/a
375n/aclass color(aetools.ComponentItem):
376n/a """color - A color. """
377n/a want = 'colr'
378n/a
379n/acolors = color
380n/a
381n/aclass window(aetools.ComponentItem):
382n/a """window - A window. """
383n/a want = 'cwin'
384n/aclass _Prop_bounds(aetools.NProperty):
385n/a """bounds - The bounding rectangle of the window. """
386n/a which = 'pbnd'
387n/a want = 'qdrt'
388n/aclass _Prop_closeable(aetools.NProperty):
389n/a """closeable - Whether the window has a close box. """
390n/a which = 'hclb'
391n/a want = 'bool'
392n/aclass _Prop_document(aetools.NProperty):
393n/a """document - The document whose contents are being displayed in the window. """
394n/a which = 'docu'
395n/a want = 'docu'
396n/aclass _Prop_floating(aetools.NProperty):
397n/a """floating - Whether the window floats. """
398n/a which = 'isfl'
399n/a want = 'bool'
400n/aclass _Prop_id(aetools.NProperty):
401n/a """id - The unique identifier of the window. """
402n/a which = 'ID '
403n/a want = 'long'
404n/aclass _Prop_index(aetools.NProperty):
405n/a """index - The index of the window in the back-to-front window ordering. """
406n/a which = 'pidx'
407n/a want = 'long'
408n/aclass _Prop_miniaturizable(aetools.NProperty):
409n/a """miniaturizable - Whether the window can be miniaturized. """
410n/a which = 'ismn'
411n/a want = 'bool'
412n/aclass _Prop_miniaturized(aetools.NProperty):
413n/a """miniaturized - Whether the window is currently miniaturized. """
414n/a which = 'pmnd'
415n/a want = 'bool'
416n/aclass _Prop_modal(aetools.NProperty):
417n/a """modal - Whether the window is the application's current modal window. """
418n/a which = 'pmod'
419n/a want = 'bool'
420n/aclass _Prop_resizable(aetools.NProperty):
421n/a """resizable - Whether the window can be resized. """
422n/a which = 'prsz'
423n/a want = 'bool'
424n/aclass _Prop_titled(aetools.NProperty):
425n/a """titled - Whether the window has a title bar. """
426n/a which = 'ptit'
427n/a want = 'bool'
428n/aclass _Prop_visible(aetools.NProperty):
429n/a """visible - Whether the window is currently visible. """
430n/a which = 'pvis'
431n/a want = 'bool'
432n/aclass _Prop_zoomable(aetools.NProperty):
433n/a """zoomable - Whether the window can be zoomed. """
434n/a which = 'iszm'
435n/a want = 'bool'
436n/aclass _Prop_zoomed(aetools.NProperty):
437n/a """zoomed - Whether the window is currently zoomed. """
438n/a which = 'pzum'
439n/a want = 'bool'
440n/a
441n/awindows = window
442n/a
443n/aclass document(aetools.ComponentItem):
444n/a """document - A document. """
445n/a want = 'docu'
446n/aclass _Prop_modified(aetools.NProperty):
447n/a """modified - Has the document been modified since the last save? """
448n/a which = 'imod'
449n/a want = 'bool'
450n/aclass _Prop_path(aetools.NProperty):
451n/a """path - The document's path. """
452n/a which = 'ppth'
453n/a want = 'utxt'
454n/a
455n/adocuments = document
456n/aapplication._superclassnames = ['item']
457n/aapplication._privpropdict = {
458n/a '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
459n/a 'frontmost' : _Prop_frontmost,
460n/a 'name' : _Prop_name,
461n/a 'version' : _Prop_version,
462n/a}
463n/aapplication._privelemdict = {
464n/a 'document' : document,
465n/a 'window' : window,
466n/a}
467n/aitem._superclassnames = []
468n/aitem._privpropdict = {
469n/a 'class_' : _Prop_class_,
470n/a 'properties' : _Prop_properties,
471n/a}
472n/aitem._privelemdict = {
473n/a}
474n/acolor._superclassnames = ['item']
475n/acolor._privpropdict = {
476n/a '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
477n/a}
478n/acolor._privelemdict = {
479n/a}
480n/awindow._superclassnames = ['item']
481n/awindow._privpropdict = {
482n/a '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
483n/a 'bounds' : _Prop_bounds,
484n/a 'closeable' : _Prop_closeable,
485n/a 'document' : _Prop_document,
486n/a 'floating' : _Prop_floating,
487n/a 'id' : _Prop_id,
488n/a 'index' : _Prop_index,
489n/a 'miniaturizable' : _Prop_miniaturizable,
490n/a 'miniaturized' : _Prop_miniaturized,
491n/a 'modal' : _Prop_modal,
492n/a 'name' : _Prop_name,
493n/a 'resizable' : _Prop_resizable,
494n/a 'titled' : _Prop_titled,
495n/a 'visible' : _Prop_visible,
496n/a 'zoomable' : _Prop_zoomable,
497n/a 'zoomed' : _Prop_zoomed,
498n/a}
499n/awindow._privelemdict = {
500n/a}
501n/adocument._superclassnames = ['item']
502n/adocument._privpropdict = {
503n/a '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
504n/a 'modified' : _Prop_modified,
505n/a 'name' : _Prop_name,
506n/a 'path' : _Prop_path,
507n/a}
508n/adocument._privelemdict = {
509n/a}
510n/aclass _3c_(aetools.NComparison):
511n/a """< - Less than """
512n/aclass _3d_(aetools.NComparison):
513n/a """= - Equal """
514n/aclass _3e_(aetools.NComparison):
515n/a """> - Greater than """
516n/aclass contains(aetools.NComparison):
517n/a """contains - Contains """
518n/aclass ends_with(aetools.NComparison):
519n/a """ends with - Ends with """
520n/aclass starts_with(aetools.NComparison):
521n/a """starts with - Starts with """
522n/aclass _b2_(aetools.NComparison):
523n/a """\xb2 - Less than or equal to """
524n/aclass _b3_(aetools.NComparison):
525n/a """\xb3 - Greater than or equal to """
526n/a_Enum_savo = {
527n/a 'ask' : 'ask ', # Ask the user whether or not to save the file.
528n/a 'yes' : 'yes ', # Save the file.
529n/a 'no' : 'no ', # Do not save the file.
530n/a}
531n/a
532n/a
533n/a#
534n/a# Indices of types declared in this module
535n/a#
536n/a_classdeclarations = {
537n/a 'capp' : application,
538n/a 'cobj' : item,
539n/a 'colr' : color,
540n/a 'cwin' : window,
541n/a 'docu' : document,
542n/a}
543n/a
544n/a_propdeclarations = {
545n/a 'ID ' : _Prop_id,
546n/a 'c@#^' : _Prop__3c_Inheritance_3e_,
547n/a 'docu' : _Prop_document,
548n/a 'hclb' : _Prop_closeable,
549n/a 'imod' : _Prop_modified,
550n/a 'isfl' : _Prop_floating,
551n/a 'ismn' : _Prop_miniaturizable,
552n/a 'iszm' : _Prop_zoomable,
553n/a 'pALL' : _Prop_properties,
554n/a 'pbnd' : _Prop_bounds,
555n/a 'pcls' : _Prop_class_,
556n/a 'pidx' : _Prop_index,
557n/a 'pisf' : _Prop_frontmost,
558n/a 'pmnd' : _Prop_miniaturized,
559n/a 'pmod' : _Prop_modal,
560n/a 'pnam' : _Prop_name,
561n/a 'ppth' : _Prop_path,
562n/a 'prsz' : _Prop_resizable,
563n/a 'ptit' : _Prop_titled,
564n/a 'pvis' : _Prop_visible,
565n/a 'pzum' : _Prop_zoomed,
566n/a 'vers' : _Prop_version,
567n/a}
568n/a
569n/a_compdeclarations = {
570n/a '< ' : _3c_,
571n/a '<= ' : _b2_,
572n/a '= ' : _3d_,
573n/a '> ' : _3e_,
574n/a '>= ' : _b3_,
575n/a 'bgwt' : starts_with,
576n/a 'cont' : contains,
577n/a 'ends' : ends_with,
578n/a}
579n/a
580n/a_enumdeclarations = {
581n/a 'savo' : _Enum_savo,
582n/a}