~ubuntu-branches/ubuntu/maverick/python3.1/maverick

« back to all changes in this revision

Viewing changes to Mac/Tools/Doc/HelpIndexingTool/Standard_Suite.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-03-23 00:01:27 UTC
  • Revision ID: james.westby@ubuntu.com-20090323000127-5fstfxju4ufrhthq
Tags: upstream-3.1~a1+20090322
ImportĀ upstreamĀ versionĀ 3.1~a1+20090322

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""Suite Standard Suite: Common terms for most applications
 
2
Level 1, version 1
 
3
 
 
4
Generated from /Developer/Applications/Apple Help Indexing Tool.app
 
5
AETE/AEUT resource version 1/1, language 0, script 0
 
6
"""
 
7
 
 
8
import aetools
 
9
import MacOS
 
10
 
 
11
_code = 'CoRe'
 
12
 
 
13
from StdSuites.Standard_Suite import *
 
14
class Standard_Suite_Events(Standard_Suite_Events):
 
15
 
 
16
    _argmap_close = {
 
17
        'saving' : 'savo',
 
18
        'in_' : 'kfil',
 
19
    }
 
20
 
 
21
    def close(self, _object, _attributes={}, **_arguments):
 
22
        """close: Close an object
 
23
        Required argument: the objects to close
 
24
        Keyword argument saving: specifies whether or not changes should be saved before closing
 
25
        Keyword argument in_: the file in which to save the object
 
26
        Keyword argument _attributes: AppleEvent attribute dictionary
 
27
        """
 
28
        _code = 'core'
 
29
        _subcode = 'clos'
 
30
 
 
31
        aetools.keysubst(_arguments, self._argmap_close)
 
32
        _arguments['----'] = _object
 
33
 
 
34
        aetools.enumsubst(_arguments, 'savo', _Enum_savo)
 
35
 
 
36
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
37
                _arguments, _attributes)
 
38
        if _arguments.get('errn', 0):
 
39
            raise aetools.Error(aetools.decodeerror(_arguments))
 
40
        # XXXX Optionally decode result
 
41
        if _arguments.has_key('----'):
 
42
            return _arguments['----']
 
43
 
 
44
    def data_size(self, _object, _attributes={}, **_arguments):
 
45
        """data size: Return the size in bytes of an object
 
46
        Required argument: the object whose data size is to be returned
 
47
        Keyword argument _attributes: AppleEvent attribute dictionary
 
48
        Returns: the size of the object in bytes
 
49
        """
 
50
        _code = 'core'
 
51
        _subcode = 'dsiz'
 
52
 
 
53
        if _arguments: raise TypeError('No optional args expected')
 
54
        _arguments['----'] = _object
 
55
 
 
56
 
 
57
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
58
                _arguments, _attributes)
 
59
        if _arguments.get('errn', 0):
 
60
            raise aetools.Error(aetools.decodeerror(_arguments))
 
61
        # XXXX Optionally decode result
 
62
        if _arguments.has_key('----'):
 
63
            return _arguments['----']
 
64
 
 
65
    def get(self, _object, _attributes={}, **_arguments):
 
66
        """get: Get the data for an object
 
67
        Required argument: the object whose data is to be returned
 
68
        Keyword argument _attributes: AppleEvent attribute dictionary
 
69
        Returns: The data from the object
 
70
        """
 
71
        _code = 'core'
 
72
        _subcode = 'getd'
 
73
 
 
74
        if _arguments: raise TypeError('No optional args expected')
 
75
        _arguments['----'] = _object
 
76
 
 
77
 
 
78
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
79
                _arguments, _attributes)
 
80
        if _arguments.get('errn', 0):
 
81
            raise aetools.Error(aetools.decodeerror(_arguments))
 
82
        # XXXX Optionally decode result
 
83
        if _arguments.has_key('----'):
 
84
            return _arguments['----']
 
85
 
 
86
    _argmap_make = {
 
87
        'new' : 'kocl',
 
88
        'at' : 'insh',
 
89
        'with_data' : 'data',
 
90
        'with_properties' : 'prdt',
 
91
    }
 
92
 
 
93
    def make(self, _no_object=None, _attributes={}, **_arguments):
 
94
        """make: Make a new element
 
95
        Keyword argument new: the class of the new element
 
96
        Keyword argument at: the location at which to insert the element
 
97
        Keyword argument with_data: the initial data for the element
 
98
        Keyword argument with_properties: the initial values for the properties of the element
 
99
        Keyword argument _attributes: AppleEvent attribute dictionary
 
100
        Returns: Object specifier for the new element
 
101
        """
 
102
        _code = 'core'
 
103
        _subcode = 'crel'
 
104
 
 
105
        aetools.keysubst(_arguments, self._argmap_make)
 
106
        if _no_object is not None: raise TypeError('No direct arg expected')
 
107
 
 
108
 
 
109
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
110
                _arguments, _attributes)
 
111
        if _arguments.get('errn', 0):
 
112
            raise aetools.Error(aetools.decodeerror(_arguments))
 
113
        # XXXX Optionally decode result
 
114
        if _arguments.has_key('----'):
 
115
            return _arguments['----']
 
116
 
 
117
    def open(self, _object, _attributes={}, **_arguments):
 
118
        """open: Open the specified object(s)
 
119
        Required argument: Objects to open. Can be a list of files or an object specifier.
 
120
        Keyword argument _attributes: AppleEvent attribute dictionary
 
121
        """
 
122
        _code = 'aevt'
 
123
        _subcode = 'odoc'
 
124
 
 
125
        if _arguments: raise TypeError('No optional args expected')
 
126
        _arguments['----'] = _object
 
127
 
 
128
 
 
129
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
130
                _arguments, _attributes)
 
131
        if _arguments.get('errn', 0):
 
132
            raise aetools.Error(aetools.decodeerror(_arguments))
 
133
        # XXXX Optionally decode result
 
134
        if _arguments.has_key('----'):
 
135
            return _arguments['----']
 
136
 
 
137
    def print_(self, _object, _attributes={}, **_arguments):
 
138
        """print: Print the specified object(s)
 
139
        Required argument: Objects to print. Can be a list of files or an object specifier.
 
140
        Keyword argument _attributes: AppleEvent attribute dictionary
 
141
        """
 
142
        _code = 'aevt'
 
143
        _subcode = 'pdoc'
 
144
 
 
145
        if _arguments: raise TypeError('No optional args expected')
 
146
        _arguments['----'] = _object
 
147
 
 
148
 
 
149
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
150
                _arguments, _attributes)
 
151
        if _arguments.get('errn', 0):
 
152
            raise aetools.Error(aetools.decodeerror(_arguments))
 
153
        # XXXX Optionally decode result
 
154
        if _arguments.has_key('----'):
 
155
            return _arguments['----']
 
156
 
 
157
    _argmap_save = {
 
158
        'in_' : 'kfil',
 
159
        'as' : 'fltp',
 
160
    }
 
161
 
 
162
    def save(self, _object, _attributes={}, **_arguments):
 
163
        """save: save a set of objects
 
164
        Required argument: Objects to save.
 
165
        Keyword argument in_: the file in which to save the object(s)
 
166
        Keyword argument as: the file type of the document in which to save the data
 
167
        Keyword argument _attributes: AppleEvent attribute dictionary
 
168
        """
 
169
        _code = 'core'
 
170
        _subcode = 'save'
 
171
 
 
172
        aetools.keysubst(_arguments, self._argmap_save)
 
173
        _arguments['----'] = _object
 
174
 
 
175
 
 
176
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
177
                _arguments, _attributes)
 
178
        if _arguments.get('errn', 0):
 
179
            raise aetools.Error(aetools.decodeerror(_arguments))
 
180
        # XXXX Optionally decode result
 
181
        if _arguments.has_key('----'):
 
182
            return _arguments['----']
 
183
 
 
184
    _argmap_set = {
 
185
        'to' : 'data',
 
186
    }
 
187
 
 
188
    def set(self, _object, _attributes={}, **_arguments):
 
189
        """set: Set an object\xd5s data
 
190
        Required argument: the object to change
 
191
        Keyword argument to: the new value
 
192
        Keyword argument _attributes: AppleEvent attribute dictionary
 
193
        """
 
194
        _code = 'core'
 
195
        _subcode = 'setd'
 
196
 
 
197
        aetools.keysubst(_arguments, self._argmap_set)
 
198
        _arguments['----'] = _object
 
199
 
 
200
 
 
201
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
202
                _arguments, _attributes)
 
203
        if _arguments.get('errn', 0):
 
204
            raise aetools.Error(aetools.decodeerror(_arguments))
 
205
        # XXXX Optionally decode result
 
206
        if _arguments.has_key('----'):
 
207
            return _arguments['----']
 
208
 
 
209
 
 
210
class application(aetools.ComponentItem):
 
211
    """application - An application program """
 
212
    want = 'capp'
 
213
#        element 'cwin' as ['indx', 'name', 'rele']
 
214
#        element 'docu' as ['name']
 
215
 
 
216
class window(aetools.ComponentItem):
 
217
    """window - A Window """
 
218
    want = 'cwin'
 
219
class _Prop_bounds(aetools.NProperty):
 
220
    """bounds - the boundary rectangle for the window """
 
221
    which = 'pbnd'
 
222
    want = 'qdrt'
 
223
class _Prop_closeable(aetools.NProperty):
 
224
    """closeable - Does the window have a close box? """
 
225
    which = 'hclb'
 
226
    want = 'bool'
 
227
class _Prop_floating(aetools.NProperty):
 
228
    """floating - Does the window float? """
 
229
    which = 'isfl'
 
230
    want = 'bool'
 
231
class _Prop_index(aetools.NProperty):
 
232
    """index - the number of the window """
 
233
    which = 'pidx'
 
234
    want = 'long'
 
235
class _Prop_modal(aetools.NProperty):
 
236
    """modal - Is the window modal? """
 
237
    which = 'pmod'
 
238
    want = 'bool'
 
239
class _Prop_name(aetools.NProperty):
 
240
    """name - the title of the window """
 
241
    which = 'pnam'
 
242
    want = 'itxt'
 
243
class _Prop_position(aetools.NProperty):
 
244
    """position - upper left coordinates of window """
 
245
    which = 'ppos'
 
246
    want = 'QDpt'
 
247
class _Prop_resizable(aetools.NProperty):
 
248
    """resizable - Is the window resizable? """
 
249
    which = 'prsz'
 
250
    want = 'bool'
 
251
class _Prop_titled(aetools.NProperty):
 
252
    """titled - Does the window have a title bar? """
 
253
    which = 'ptit'
 
254
    want = 'bool'
 
255
class _Prop_visible(aetools.NProperty):
 
256
    """visible - is the window visible? """
 
257
    which = 'pvis'
 
258
    want = 'bool'
 
259
class _Prop_zoomable(aetools.NProperty):
 
260
    """zoomable - Is the window zoomable? """
 
261
    which = 'iszm'
 
262
    want = 'bool'
 
263
class _Prop_zoomed(aetools.NProperty):
 
264
    """zoomed - Is the window zoomed? """
 
265
    which = 'pzum'
 
266
    want = 'bool'
 
267
 
 
268
class document(aetools.ComponentItem):
 
269
    """document - A Document """
 
270
    want = 'docu'
 
271
class _Prop_modified(aetools.NProperty):
 
272
    """modified - Has the document been modified since the last save? """
 
273
    which = 'imod'
 
274
    want = 'bool'
 
275
application._superclassnames = []
 
276
application._privpropdict = {
 
277
}
 
278
application._privelemdict = {
 
279
    'document' : document,
 
280
    'window' : window,
 
281
}
 
282
window._superclassnames = []
 
283
window._privpropdict = {
 
284
    'bounds' : _Prop_bounds,
 
285
    'closeable' : _Prop_closeable,
 
286
    'floating' : _Prop_floating,
 
287
    'index' : _Prop_index,
 
288
    'modal' : _Prop_modal,
 
289
    'name' : _Prop_name,
 
290
    'position' : _Prop_position,
 
291
    'resizable' : _Prop_resizable,
 
292
    'titled' : _Prop_titled,
 
293
    'visible' : _Prop_visible,
 
294
    'zoomable' : _Prop_zoomable,
 
295
    'zoomed' : _Prop_zoomed,
 
296
}
 
297
window._privelemdict = {
 
298
}
 
299
document._superclassnames = []
 
300
document._privpropdict = {
 
301
    'modified' : _Prop_modified,
 
302
    'name' : _Prop_name,
 
303
}
 
304
document._privelemdict = {
 
305
}
 
306
_Enum_savo = {
 
307
    'yes' : 'yes ',     # Save objects now
 
308
    'no' : 'no  ',      # Do not save objects
 
309
    'ask' : 'ask ',     # Ask the user whether to save
 
310
}
 
311
 
 
312
 
 
313
#
 
314
# Indices of types declared in this module
 
315
#
 
316
_classdeclarations = {
 
317
    'capp' : application,
 
318
    'cwin' : window,
 
319
    'docu' : document,
 
320
}
 
321
 
 
322
_propdeclarations = {
 
323
    'hclb' : _Prop_closeable,
 
324
    'imod' : _Prop_modified,
 
325
    'isfl' : _Prop_floating,
 
326
    'iszm' : _Prop_zoomable,
 
327
    'pbnd' : _Prop_bounds,
 
328
    'pidx' : _Prop_index,
 
329
    'pmod' : _Prop_modal,
 
330
    'pnam' : _Prop_name,
 
331
    'ppos' : _Prop_position,
 
332
    'prsz' : _Prop_resizable,
 
333
    'ptit' : _Prop_titled,
 
334
    'pvis' : _Prop_visible,
 
335
    'pzum' : _Prop_zoomed,
 
336
}
 
337
 
 
338
_compdeclarations = {
 
339
}
 
340
 
 
341
_enumdeclarations = {
 
342
    'savo' : _Enum_savo,
 
343
}