Added ref to Misc/NEWS file; added hint to run regen script on Linux.
[python/dscho.git] / Mac / Demo / scripting / Standard_Suite.py
blobcd11b9ddb49d5eeeb98cb95150216272de7d2a67
1 """Suite Standard Suite: Common terms for most applications
2 Level 1, version 1
4 Generated from Moes:Programma's:Eudora:Eudora Light
5 AETE/AEUT resource version 2/16, language 0, script 0
6 """
8 import addpack
9 addpack.addpack('Tools')
10 addpack.addpack('bgen')
11 addpack.addpack('ae')
13 import aetools
14 import MacOS
16 _code = 'CoRe'
18 class Standard_Suite:
20 def close(self, _object, _attributes={}, **_arguments):
21 """close: Close an object
22 Required argument: the object to close
23 Keyword argument _attributes: AppleEvent attribute dictionary
24 """
25 _code = 'core'
26 _subcode = 'clos'
28 if _arguments: raise TypeError, 'No optional args expected'
29 _arguments['----'] = _object
32 _reply, _arguments, _attributes = self.send(_code, _subcode,
33 _arguments, _attributes)
34 if _arguments.has_key('errn'):
35 raise MacOS.Error, aetools.decodeerror(_arguments)
36 # XXXX Optionally decode result
37 if _arguments.has_key('----'):
38 return _arguments['----']
40 _argmap_count = {
41 'each' : 'kocl',
44 def count(self, _object, _attributes={}, **_arguments):
45 """count: Return the number of elements of a particular class within an object
46 Required argument: the object whose elements are to be counted
47 Keyword argument each: the class of the elements to be counted. Keyword 'each' is optional in AppleScript
48 Keyword argument _attributes: AppleEvent attribute dictionary
49 Returns: the number of elements
50 """
51 _code = 'core'
52 _subcode = 'cnte'
54 aetools.keysubst(_arguments, self._argmap_count)
55 _arguments['----'] = _object
58 _reply, _arguments, _attributes = self.send(_code, _subcode,
59 _arguments, _attributes)
60 if _arguments.has_key('errn'):
61 raise MacOS.Error, aetools.decodeerror(_arguments)
62 # XXXX Optionally decode result
63 if _arguments.has_key('----'):
64 return _arguments['----']
66 def exists(self, _object, _attributes={}, **_arguments):
67 """exists: Verify if an object exists
68 Required argument: the object in question
69 Keyword argument _attributes: AppleEvent attribute dictionary
70 Returns: true if it exists, false if not
71 """
72 _code = 'core'
73 _subcode = 'doex'
75 if _arguments: raise TypeError, 'No optional args expected'
76 _arguments['----'] = _object
79 _reply, _arguments, _attributes = self.send(_code, _subcode,
80 _arguments, _attributes)
81 if _arguments.has_key('errn'):
82 raise MacOS.Error, aetools.decodeerror(_arguments)
83 # XXXX Optionally decode result
84 if _arguments.has_key('----'):
85 return _arguments['----']
87 def get(self, _object, _attributes={}, **_arguments):
88 """get: Get the data for an object
89 Required argument: the object whose data is to be returned
90 Keyword argument _attributes: AppleEvent attribute dictionary
91 Returns: the data from the object
92 """
93 _code = 'core'
94 _subcode = 'getd'
96 if _arguments: raise TypeError, 'No optional args expected'
97 _arguments['----'] = _object
100 _reply, _arguments, _attributes = self.send(_code, _subcode,
101 _arguments, _attributes)
102 if _arguments.has_key('errn'):
103 raise MacOS.Error, aetools.decodeerror(_arguments)
104 # XXXX Optionally decode result
105 if _arguments.has_key('----'):
106 return _arguments['----']
108 _argmap_make = {
109 'new' : 'kocl',
110 'at' : 'insh',
113 def make(self, _no_object=None, _attributes={}, **_arguments):
114 """make: Make a new element
115 Keyword argument new: the class of the new element. Keyword 'new' is optional in AppleScript
116 Keyword argument at: the location at which to insert the element
117 Keyword argument _attributes: AppleEvent attribute dictionary
118 Returns: to the new object
120 _code = 'core'
121 _subcode = 'crel'
123 aetools.keysubst(_arguments, self._argmap_make)
124 if _no_object != None: raise TypeError, 'No direct arg expected'
127 _reply, _arguments, _attributes = self.send(_code, _subcode,
128 _arguments, _attributes)
129 if _arguments.has_key('errn'):
130 raise MacOS.Error, aetools.decodeerror(_arguments)
131 # XXXX Optionally decode result
132 if _arguments.has_key('----'):
133 return _arguments['----']
135 _argmap_move = {
136 'to' : 'insh',
139 def move(self, _object, _attributes={}, **_arguments):
140 """move: Move object to a new location
141 Required argument: the object to move
142 Keyword argument to: the new location for the object
143 Keyword argument _attributes: AppleEvent attribute dictionary
144 Returns: to the object after they have been moved
146 _code = 'core'
147 _subcode = 'move'
149 aetools.keysubst(_arguments, self._argmap_move)
150 _arguments['----'] = _object
153 _reply, _arguments, _attributes = self.send(_code, _subcode,
154 _arguments, _attributes)
155 if _arguments.has_key('errn'):
156 raise MacOS.Error, aetools.decodeerror(_arguments)
157 # XXXX Optionally decode result
158 if _arguments.has_key('----'):
159 return _arguments['----']
161 _argmap_duplicate = {
162 'to' : 'insh',
165 def duplicate(self, _object, _attributes={}, **_arguments):
166 """duplicate: Make a duplicate object
167 Required argument: the object to move
168 Keyword argument to: the new location for the object
169 Keyword argument _attributes: AppleEvent attribute dictionary
170 Returns: to the object after they have been moved
172 _code = 'core'
173 _subcode = 'clon'
175 aetools.keysubst(_arguments, self._argmap_duplicate)
176 _arguments['----'] = _object
179 _reply, _arguments, _attributes = self.send(_code, _subcode,
180 _arguments, _attributes)
181 if _arguments.has_key('errn'):
182 raise MacOS.Error, aetools.decodeerror(_arguments)
183 # XXXX Optionally decode result
184 if _arguments.has_key('----'):
185 return _arguments['----']
187 def open(self, _object, _attributes={}, **_arguments):
188 """open: Open the specified object
189 Required argument: list of objects to open
190 Keyword argument _attributes: AppleEvent attribute dictionary
192 _code = 'aevt'
193 _subcode = 'odoc'
195 if _arguments: raise TypeError, 'No optional args expected'
196 _arguments['----'] = _object
199 _reply, _arguments, _attributes = self.send(_code, _subcode,
200 _arguments, _attributes)
201 if _arguments.has_key('errn'):
202 raise MacOS.Error, aetools.decodeerror(_arguments)
203 # XXXX Optionally decode result
204 if _arguments.has_key('----'):
205 return _arguments['----']
207 def _print(self, _object, _attributes={}, **_arguments):
208 """print: Print the specified message
209 Required argument: the message to print
210 Keyword argument _attributes: AppleEvent attribute dictionary
212 _code = 'aevt'
213 _subcode = 'pdoc'
215 if _arguments: raise TypeError, 'No optional args expected'
216 _arguments['----'] = _object
219 _reply, _arguments, _attributes = self.send(_code, _subcode,
220 _arguments, _attributes)
221 if _arguments.has_key('errn'):
222 raise MacOS.Error, aetools.decodeerror(_arguments)
223 # XXXX Optionally decode result
224 if _arguments.has_key('----'):
225 return _arguments['----']
227 def save(self, _object, _attributes={}, **_arguments):
228 """save: Save an object
229 Required argument: the composition message to save
230 Keyword argument _attributes: AppleEvent attribute dictionary
232 _code = 'core'
233 _subcode = 'save'
235 if _arguments: raise TypeError, 'No optional args expected'
236 _arguments['----'] = _object
239 _reply, _arguments, _attributes = self.send(_code, _subcode,
240 _arguments, _attributes)
241 if _arguments.has_key('errn'):
242 raise MacOS.Error, aetools.decodeerror(_arguments)
243 # XXXX Optionally decode result
244 if _arguments.has_key('----'):
245 return _arguments['----']
247 _argmap_set = {
248 'to' : 'data',
251 def set(self, _object, _attributes={}, **_arguments):
252 """set: Set an object's data
253 Required argument: the object to change
254 Keyword argument to: the new value
255 Keyword argument _attributes: AppleEvent attribute dictionary
257 _code = 'core'
258 _subcode = 'setd'
260 aetools.keysubst(_arguments, self._argmap_set)
261 _arguments['----'] = _object
264 _reply, _arguments, _attributes = self.send(_code, _subcode,
265 _arguments, _attributes)
266 if _arguments.has_key('errn'):
267 raise MacOS.Error, aetools.decodeerror(_arguments)
268 # XXXX Optionally decode result
269 if _arguments.has_key('----'):
270 return _arguments['----']
273 # Class 'application' ('capp') -- 'An application program'
274 # property 'version' ('vers') 'itxt' -- 'the version number' []
275 # property 'selected text' ('eStx') 'TEXT' -- 'the text of the user\325s current selection' []
276 # element 'euMF' as ['indx', 'name']
277 # element 'ePrf' as ['indx']