Oops -- Lib/Test should be Lib/test, of course!
[python/dscho.git] / Mac / Demo / scripting / Standard_Suite.py
blobce5baadb18377b7bec66c2d29e2098ac0a4610f1
1 """Suite Standard Suite: Common terms for most applications
2 Level 1, version 1
4 Generated from flap:Programma's:Eudora Light
5 AETE/AEUT resource version 2/16, language 0, script 0
6 """
8 import aetools
9 import MacOS
11 _code = 'CoRe'
13 class Standard_Suite:
15 def close(self, _object, _attributes={}, **_arguments):
16 """close: Close an object
17 Required argument: the object to close
18 Keyword argument _attributes: AppleEvent attribute dictionary
19 """
20 _code = 'core'
21 _subcode = 'clos'
23 if _arguments: raise TypeError, 'No optional args expected'
24 _arguments['----'] = _object
27 _reply, _arguments, _attributes = self.send(_code, _subcode,
28 _arguments, _attributes)
29 if _arguments.has_key('errn'):
30 raise aetools.Error, aetools.decodeerror(_arguments)
31 # XXXX Optionally decode result
32 if _arguments.has_key('----'):
33 return _arguments['----']
35 _argmap_count = {
36 'each' : 'kocl',
39 def count(self, _object, _attributes={}, **_arguments):
40 """count: Return the number of elements of a particular class within an object
41 Required argument: the object whose elements are to be counted
42 Keyword argument each: the class of the elements to be counted. Keyword 'each' is optional in AppleScript
43 Keyword argument _attributes: AppleEvent attribute dictionary
44 Returns: the number of elements
45 """
46 _code = 'core'
47 _subcode = 'cnte'
49 aetools.keysubst(_arguments, self._argmap_count)
50 _arguments['----'] = _object
53 _reply, _arguments, _attributes = self.send(_code, _subcode,
54 _arguments, _attributes)
55 if _arguments.has_key('errn'):
56 raise aetools.Error, aetools.decodeerror(_arguments)
57 # XXXX Optionally decode result
58 if _arguments.has_key('----'):
59 return _arguments['----']
61 def exists(self, _object, _attributes={}, **_arguments):
62 """exists: Verify if an object exists
63 Required argument: the object in question
64 Keyword argument _attributes: AppleEvent attribute dictionary
65 Returns: true if it exists, false if not
66 """
67 _code = 'core'
68 _subcode = 'doex'
70 if _arguments: raise TypeError, 'No optional args expected'
71 _arguments['----'] = _object
74 _reply, _arguments, _attributes = self.send(_code, _subcode,
75 _arguments, _attributes)
76 if _arguments.has_key('errn'):
77 raise aetools.Error, aetools.decodeerror(_arguments)
78 # XXXX Optionally decode result
79 if _arguments.has_key('----'):
80 return _arguments['----']
82 def get(self, _object, _attributes={}, **_arguments):
83 """get: Get the data for an object
84 Required argument: the object whose data is to be returned
85 Keyword argument _attributes: AppleEvent attribute dictionary
86 Returns: the data from the object
87 """
88 _code = 'core'
89 _subcode = 'getd'
91 if _arguments: raise TypeError, 'No optional args expected'
92 _arguments['----'] = _object
95 _reply, _arguments, _attributes = self.send(_code, _subcode,
96 _arguments, _attributes)
97 if _arguments.has_key('errn'):
98 raise aetools.Error, aetools.decodeerror(_arguments)
99 # XXXX Optionally decode result
100 if _arguments.has_key('----'):
101 return _arguments['----']
103 _argmap_make = {
104 'new' : 'kocl',
105 'at' : 'insh',
108 def make(self, _no_object=None, _attributes={}, **_arguments):
109 """make: Make a new element
110 Keyword argument new: the class of the new element. Keyword 'new' is optional in AppleScript
111 Keyword argument at: the location at which to insert the element
112 Keyword argument _attributes: AppleEvent attribute dictionary
113 Returns: to the new object
115 _code = 'core'
116 _subcode = 'crel'
118 aetools.keysubst(_arguments, self._argmap_make)
119 if _no_object != None: raise TypeError, 'No direct arg expected'
122 _reply, _arguments, _attributes = self.send(_code, _subcode,
123 _arguments, _attributes)
124 if _arguments.has_key('errn'):
125 raise aetools.Error, aetools.decodeerror(_arguments)
126 # XXXX Optionally decode result
127 if _arguments.has_key('----'):
128 return _arguments['----']
130 _argmap_move = {
131 'to' : 'insh',
134 def move(self, _object, _attributes={}, **_arguments):
135 """move: Move object to a new location
136 Required argument: the object to move
137 Keyword argument to: the new location for the object
138 Keyword argument _attributes: AppleEvent attribute dictionary
139 Returns: to the object after they have been moved
141 _code = 'core'
142 _subcode = 'move'
144 aetools.keysubst(_arguments, self._argmap_move)
145 _arguments['----'] = _object
148 _reply, _arguments, _attributes = self.send(_code, _subcode,
149 _arguments, _attributes)
150 if _arguments.has_key('errn'):
151 raise aetools.Error, aetools.decodeerror(_arguments)
152 # XXXX Optionally decode result
153 if _arguments.has_key('----'):
154 return _arguments['----']
156 _argmap_duplicate = {
157 'to' : 'insh',
160 def duplicate(self, _object, _attributes={}, **_arguments):
161 """duplicate: Make a duplicate object
162 Required argument: the object to move
163 Keyword argument to: the new location for the object
164 Keyword argument _attributes: AppleEvent attribute dictionary
165 Returns: to the object after they have been moved
167 _code = 'core'
168 _subcode = 'clon'
170 aetools.keysubst(_arguments, self._argmap_duplicate)
171 _arguments['----'] = _object
174 _reply, _arguments, _attributes = self.send(_code, _subcode,
175 _arguments, _attributes)
176 if _arguments.has_key('errn'):
177 raise aetools.Error, aetools.decodeerror(_arguments)
178 # XXXX Optionally decode result
179 if _arguments.has_key('----'):
180 return _arguments['----']
182 def open(self, _object, _attributes={}, **_arguments):
183 """open: Open the specified object
184 Required argument: list of objects to open
185 Keyword argument _attributes: AppleEvent attribute dictionary
187 _code = 'aevt'
188 _subcode = 'odoc'
190 if _arguments: raise TypeError, 'No optional args expected'
191 _arguments['----'] = _object
194 _reply, _arguments, _attributes = self.send(_code, _subcode,
195 _arguments, _attributes)
196 if _arguments.has_key('errn'):
197 raise aetools.Error, aetools.decodeerror(_arguments)
198 # XXXX Optionally decode result
199 if _arguments.has_key('----'):
200 return _arguments['----']
202 def _print(self, _object, _attributes={}, **_arguments):
203 """print: Print the specified message
204 Required argument: the message to print
205 Keyword argument _attributes: AppleEvent attribute dictionary
207 _code = 'aevt'
208 _subcode = 'pdoc'
210 if _arguments: raise TypeError, 'No optional args expected'
211 _arguments['----'] = _object
214 _reply, _arguments, _attributes = self.send(_code, _subcode,
215 _arguments, _attributes)
216 if _arguments.has_key('errn'):
217 raise aetools.Error, aetools.decodeerror(_arguments)
218 # XXXX Optionally decode result
219 if _arguments.has_key('----'):
220 return _arguments['----']
222 def save(self, _object, _attributes={}, **_arguments):
223 """save: Save an object
224 Required argument: the composition message to save
225 Keyword argument _attributes: AppleEvent attribute dictionary
227 _code = 'core'
228 _subcode = 'save'
230 if _arguments: raise TypeError, 'No optional args expected'
231 _arguments['----'] = _object
234 _reply, _arguments, _attributes = self.send(_code, _subcode,
235 _arguments, _attributes)
236 if _arguments.has_key('errn'):
237 raise aetools.Error, aetools.decodeerror(_arguments)
238 # XXXX Optionally decode result
239 if _arguments.has_key('----'):
240 return _arguments['----']
242 _argmap_set = {
243 'to' : 'data',
246 def set(self, _object, _attributes={}, **_arguments):
247 """set: Set an object's data
248 Required argument: the object to change
249 Keyword argument to: the new value
250 Keyword argument _attributes: AppleEvent attribute dictionary
252 _code = 'core'
253 _subcode = 'setd'
255 aetools.keysubst(_arguments, self._argmap_set)
256 _arguments['----'] = _object
259 _reply, _arguments, _attributes = self.send(_code, _subcode,
260 _arguments, _attributes)
261 if _arguments.has_key('errn'):
262 raise aetools.Error, aetools.decodeerror(_arguments)
263 # XXXX Optionally decode result
264 if _arguments.has_key('----'):
265 return _arguments['----']
268 # Class 'application' ('capp') -- 'An application program'
269 # property 'version' ('vers') 'itxt' -- 'the version number' []
270 # property 'selected text' ('eStx') 'TEXT' -- 'the text of the user\325s current selection' []
271 # element 'euMF' as ['indx', 'name']
272 # element 'ePrf' as ['indx']