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

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

#countcontent
1n/a"""Suite Terminal Suite: Terms and Events for controlling the Terminal application
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 = 'trmx'
12n/a
13n/aclass Terminal_Suite_Events:
14n/a
15n/a def GetURL(self, _object, _attributes={}, **_arguments):
16n/a """GetURL: Opens a telnet: URL
17n/a Required argument: the object for the command
18n/a Keyword argument _attributes: AppleEvent attribute dictionary
19n/a """
20n/a _code = 'GURL'
21n/a _subcode = 'GURL'
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_do_script = {
36n/a 'in_' : 'kfil',
37n/a 'with_command' : 'cmnd',
38n/a }
39n/a
40n/a def do_script(self, _object, _attributes={}, **_arguments):
41n/a """do script: Run a UNIX shell script or command
42n/a Required argument: the object for the command
43n/a Keyword argument in_: the window in which to execute the command
44n/a Keyword argument with_command: data to be passed to the Terminal application as the command line, deprecated, use direct parameter
45n/a Keyword argument _attributes: AppleEvent attribute dictionary
46n/a Returns: the reply for the command
47n/a """
48n/a _code = 'core'
49n/a _subcode = 'dosc'
50n/a
51n/a aetools.keysubst(_arguments, self._argmap_do_script)
52n/a _arguments['----'] = _object
53n/a
54n/a
55n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
56n/a _arguments, _attributes)
57n/a if _arguments.get('errn', 0):
58n/a raise aetools.Error, aetools.decodeerror(_arguments)
59n/a # XXXX Optionally decode result
60n/a if _arguments.has_key('----'):
61n/a return _arguments['----']
62n/a
63n/a
64n/aclass application(aetools.ComponentItem):
65n/a """application - The Terminal program """
66n/a want = 'capp'
67n/aclass _Prop__3c_Inheritance_3e_(aetools.NProperty):
68n/a """<Inheritance> - All of the properties of the superclass. """
69n/a which = 'c@#^'
70n/a want = 'capp'
71n/a_3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_()
72n/aclass _Prop_properties(aetools.NProperty):
73n/a """properties - every property of the Terminal program """
74n/a which = 'pALL'
75n/a want = '****'
76n/aproperties = _Prop_properties()
77n/a# element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID ']
78n/a# element 'docu' as ['name', 'indx', 'rele', 'rang', 'test']
79n/a
80n/aapplications = application
81n/a
82n/aclass window(aetools.ComponentItem):
83n/a """window - A Terminal window """
84n/a want = 'cwin'
85n/aclass _Prop_background_color(aetools.NProperty):
86n/a """background color - the background color for the window """
87n/a which = 'pbcl'
88n/a want = '****'
89n/aclass _Prop_bold_text_color(aetools.NProperty):
90n/a """bold text color - the bold text color for the window """
91n/a which = 'pbtc'
92n/a want = '****'
93n/aclass _Prop_bounds(aetools.NProperty):
94n/a """bounds - the boundary rectangle for the window, relative to the upper left corner of the screen """
95n/a which = 'pbnd'
96n/a want = '****'
97n/aclass _Prop_busy(aetools.NProperty):
98n/a """busy - Is the window busy running a process? """
99n/a which = 'busy'
100n/a want = 'bool'
101n/aclass _Prop_contents(aetools.NProperty):
102n/a """contents - the currently visible contents of the window """
103n/a which = 'pcnt'
104n/a want = 'utxt'
105n/aclass _Prop_cursor_color(aetools.NProperty):
106n/a """cursor color - the cursor color for the window """
107n/a which = 'pcuc'
108n/a want = '****'
109n/aclass _Prop_custom_title(aetools.NProperty):
110n/a """custom title - the custom title for the window """
111n/a which = 'titl'
112n/a want = 'utxt'
113n/aclass _Prop_frame(aetools.NProperty):
114n/a """frame - the origin and size of the window """
115n/a which = 'pfra'
116n/a want = '****'
117n/aclass _Prop_frontmost(aetools.NProperty):
118n/a """frontmost - Is the window in front of the other Terminal windows? """
119n/a which = 'pisf'
120n/a want = 'bool'
121n/aclass _Prop_history(aetools.NProperty):
122n/a """history - the contents of the entire scrolling buffer of the window """
123n/a which = 'hist'
124n/a want = 'utxt'
125n/aclass _Prop_normal_text_color(aetools.NProperty):
126n/a """normal text color - the normal text color for the window """
127n/a which = 'ptxc'
128n/a want = '****'
129n/aclass _Prop_number_of_columns(aetools.NProperty):
130n/a """number of columns - the number of columns in the window """
131n/a which = 'ccol'
132n/a want = 'long'
133n/aclass _Prop_number_of_rows(aetools.NProperty):
134n/a """number of rows - the number of rows in the window """
135n/a which = 'crow'
136n/a want = 'long'
137n/aclass _Prop_origin(aetools.NProperty):
138n/a """origin - the lower left coordinates of the window, relative to the lower left corner of the screen """
139n/a which = 'pori'
140n/a want = '****'
141n/aclass _Prop_position(aetools.NProperty):
142n/a """position - the upper left coordinates of the window, relative to the upper left corner of the screen """
143n/a which = 'ppos'
144n/a want = '****'
145n/aclass _Prop_processes(aetools.NProperty):
146n/a """processes - a list of the currently running processes """
147n/a which = 'prcs'
148n/a want = 'utxt'
149n/aclass _Prop_size(aetools.NProperty):
150n/a """size - the width and height of the window """
151n/a which = 'psiz'
152n/a want = '****'
153n/aclass _Prop_title_displays_custom_title(aetools.NProperty):
154n/a """title displays custom title - Does the title for the window contain a custom title? """
155n/a which = 'tdct'
156n/a want = 'bool'
157n/aclass _Prop_title_displays_device_name(aetools.NProperty):
158n/a """title displays device name - Does the title for the window contain the device name? """
159n/a which = 'tddn'
160n/a want = 'bool'
161n/aclass _Prop_title_displays_file_name(aetools.NProperty):
162n/a """title displays file name - Does the title for the window contain the file name? """
163n/a which = 'tdfn'
164n/a want = 'bool'
165n/aclass _Prop_title_displays_shell_path(aetools.NProperty):
166n/a """title displays shell path - Does the title for the window contain the shell path? """
167n/a which = 'tdsp'
168n/a want = 'bool'
169n/aclass _Prop_title_displays_window_size(aetools.NProperty):
170n/a """title displays window size - Does the title for the window contain the window size? """
171n/a which = 'tdws'
172n/a want = 'bool'
173n/a
174n/awindows = window
175n/aapplication._superclassnames = []
176n/aimport Standard_Suite
177n/aapplication._privpropdict = {
178n/a '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
179n/a 'properties' : _Prop_properties,
180n/a}
181n/aapplication._privelemdict = {
182n/a 'document' : Standard_Suite.document,
183n/a 'window' : window,
184n/a}
185n/awindow._superclassnames = []
186n/awindow._privpropdict = {
187n/a '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
188n/a 'background_color' : _Prop_background_color,
189n/a 'bold_text_color' : _Prop_bold_text_color,
190n/a 'bounds' : _Prop_bounds,
191n/a 'busy' : _Prop_busy,
192n/a 'contents' : _Prop_contents,
193n/a 'cursor_color' : _Prop_cursor_color,
194n/a 'custom_title' : _Prop_custom_title,
195n/a 'frame' : _Prop_frame,
196n/a 'frontmost' : _Prop_frontmost,
197n/a 'history' : _Prop_history,
198n/a 'normal_text_color' : _Prop_normal_text_color,
199n/a 'number_of_columns' : _Prop_number_of_columns,
200n/a 'number_of_rows' : _Prop_number_of_rows,
201n/a 'origin' : _Prop_origin,
202n/a 'position' : _Prop_position,
203n/a 'processes' : _Prop_processes,
204n/a 'properties' : _Prop_properties,
205n/a 'size' : _Prop_size,
206n/a 'title_displays_custom_title' : _Prop_title_displays_custom_title,
207n/a 'title_displays_device_name' : _Prop_title_displays_device_name,
208n/a 'title_displays_file_name' : _Prop_title_displays_file_name,
209n/a 'title_displays_shell_path' : _Prop_title_displays_shell_path,
210n/a 'title_displays_window_size' : _Prop_title_displays_window_size,
211n/a}
212n/awindow._privelemdict = {
213n/a}
214n/a
215n/a#
216n/a# Indices of types declared in this module
217n/a#
218n/a_classdeclarations = {
219n/a 'capp' : application,
220n/a 'cwin' : window,
221n/a}
222n/a
223n/a_propdeclarations = {
224n/a 'busy' : _Prop_busy,
225n/a 'c@#^' : _Prop__3c_Inheritance_3e_,
226n/a 'ccol' : _Prop_number_of_columns,
227n/a 'crow' : _Prop_number_of_rows,
228n/a 'hist' : _Prop_history,
229n/a 'pALL' : _Prop_properties,
230n/a 'pbcl' : _Prop_background_color,
231n/a 'pbnd' : _Prop_bounds,
232n/a 'pbtc' : _Prop_bold_text_color,
233n/a 'pcnt' : _Prop_contents,
234n/a 'pcuc' : _Prop_cursor_color,
235n/a 'pfra' : _Prop_frame,
236n/a 'pisf' : _Prop_frontmost,
237n/a 'pori' : _Prop_origin,
238n/a 'ppos' : _Prop_position,
239n/a 'prcs' : _Prop_processes,
240n/a 'psiz' : _Prop_size,
241n/a 'ptxc' : _Prop_normal_text_color,
242n/a 'tdct' : _Prop_title_displays_custom_title,
243n/a 'tddn' : _Prop_title_displays_device_name,
244n/a 'tdfn' : _Prop_title_displays_file_name,
245n/a 'tdsp' : _Prop_title_displays_shell_path,
246n/a 'tdws' : _Prop_title_displays_window_size,
247n/a 'titl' : _Prop_custom_title,
248n/a}
249n/a
250n/a_compdeclarations = {
251n/a}
252n/a
253n/a_enumdeclarations = {
254n/a}