~malept/ubuntu/lucid/python2.6/dev-dependency-fix

« back to all changes in this revision

Viewing changes to Lib/plat-mac/lib-scriptpackages/Finder/Standard_Suite.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-13 12:51:00 UTC
  • Revision ID: james.westby@ubuntu.com-20090213125100-uufgcb9yeqzujpqw
Tags: upstream-2.6.1
ImportĀ upstreamĀ versionĀ 2.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""Suite Standard Suite: Common terms that most applications should support
 
2
Level 1, version 1
 
3
 
 
4
Generated from /System/Library/CoreServices/Finder.app
 
5
AETE/AEUT resource version 0/144, 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
    def close(self, _object, _attributes={}, **_arguments):
 
17
        """close: Close an object
 
18
        Required argument: the object to close
 
19
        Keyword argument _attributes: AppleEvent attribute dictionary
 
20
        """
 
21
        _code = 'core'
 
22
        _subcode = 'clos'
 
23
 
 
24
        if _arguments: raise TypeError, 'No optional args expected'
 
25
        _arguments['----'] = _object
 
26
 
 
27
 
 
28
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
29
                _arguments, _attributes)
 
30
        if _arguments.get('errn', 0):
 
31
            raise aetools.Error, aetools.decodeerror(_arguments)
 
32
        # XXXX Optionally decode result
 
33
        if _arguments.has_key('----'):
 
34
            return _arguments['----']
 
35
 
 
36
    _argmap_count = {
 
37
        'each' : 'kocl',
 
38
    }
 
39
 
 
40
    def count(self, _object, _attributes={}, **_arguments):
 
41
        """count: Return the number of elements of a particular class within an object
 
42
        Required argument: the object whose elements are to be counted
 
43
        Keyword argument each: the class of the elements to be counted
 
44
        Keyword argument _attributes: AppleEvent attribute dictionary
 
45
        Returns: the number of elements
 
46
        """
 
47
        _code = 'core'
 
48
        _subcode = 'cnte'
 
49
 
 
50
        aetools.keysubst(_arguments, self._argmap_count)
 
51
        _arguments['----'] = _object
 
52
 
 
53
 
 
54
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
55
                _arguments, _attributes)
 
56
        if _arguments.get('errn', 0):
 
57
            raise aetools.Error, aetools.decodeerror(_arguments)
 
58
        # XXXX Optionally decode result
 
59
        if _arguments.has_key('----'):
 
60
            return _arguments['----']
 
61
 
 
62
    _argmap_data_size = {
 
63
        'as' : 'rtyp',
 
64
    }
 
65
 
 
66
    def data_size(self, _object, _attributes={}, **_arguments):
 
67
        """data size: Return the size in bytes of an object
 
68
        Required argument: the object whose data size is to be returned
 
69
        Keyword argument as: the data type for which the size is calculated
 
70
        Keyword argument _attributes: AppleEvent attribute dictionary
 
71
        Returns: the size of the object in bytes
 
72
        """
 
73
        _code = 'core'
 
74
        _subcode = 'dsiz'
 
75
 
 
76
        aetools.keysubst(_arguments, self._argmap_data_size)
 
77
        _arguments['----'] = _object
 
78
 
 
79
 
 
80
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
81
                _arguments, _attributes)
 
82
        if _arguments.get('errn', 0):
 
83
            raise aetools.Error, aetools.decodeerror(_arguments)
 
84
        # XXXX Optionally decode result
 
85
        if _arguments.has_key('----'):
 
86
            return _arguments['----']
 
87
 
 
88
    def delete(self, _object, _attributes={}, **_arguments):
 
89
        """delete: Move an item from its container to the trash
 
90
        Required argument: the item to delete
 
91
        Keyword argument _attributes: AppleEvent attribute dictionary
 
92
        Returns: to the item that was just deleted
 
93
        """
 
94
        _code = 'core'
 
95
        _subcode = 'delo'
 
96
 
 
97
        if _arguments: raise TypeError, 'No optional args expected'
 
98
        _arguments['----'] = _object
 
99
 
 
100
 
 
101
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
102
                _arguments, _attributes)
 
103
        if _arguments.get('errn', 0):
 
104
            raise aetools.Error, aetools.decodeerror(_arguments)
 
105
        # XXXX Optionally decode result
 
106
        if _arguments.has_key('----'):
 
107
            return _arguments['----']
 
108
 
 
109
    _argmap_duplicate = {
 
110
        'to' : 'insh',
 
111
        'replacing' : 'alrp',
 
112
        'routing_suppressed' : 'rout',
 
113
    }
 
114
 
 
115
    def duplicate(self, _object, _attributes={}, **_arguments):
 
116
        """duplicate: Duplicate one or more object(s)
 
117
        Required argument: the object(s) to duplicate
 
118
        Keyword argument to: the new location for the object(s)
 
119
        Keyword argument replacing: Specifies whether or not to replace items in the destination that have the same name as items being duplicated
 
120
        Keyword argument routing_suppressed: Specifies whether or not to autoroute items (default is false). Only applies when copying to the system folder.
 
121
        Keyword argument _attributes: AppleEvent attribute dictionary
 
122
        Returns: to the duplicated object(s)
 
123
        """
 
124
        _code = 'core'
 
125
        _subcode = 'clon'
 
126
 
 
127
        aetools.keysubst(_arguments, self._argmap_duplicate)
 
128
        _arguments['----'] = _object
 
129
 
 
130
        aetools.enumsubst(_arguments, 'alrp', _Enum_bool)
 
131
        aetools.enumsubst(_arguments, 'rout', _Enum_bool)
 
132
 
 
133
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
134
                _arguments, _attributes)
 
135
        if _arguments.get('errn', 0):
 
136
            raise aetools.Error, aetools.decodeerror(_arguments)
 
137
        # XXXX Optionally decode result
 
138
        if _arguments.has_key('----'):
 
139
            return _arguments['----']
 
140
 
 
141
    def exists(self, _object, _attributes={}, **_arguments):
 
142
        """exists: Verify if an object exists
 
143
        Required argument: the object in question
 
144
        Keyword argument _attributes: AppleEvent attribute dictionary
 
145
        Returns: true if it exists, false if not
 
146
        """
 
147
        _code = 'core'
 
148
        _subcode = 'doex'
 
149
 
 
150
        if _arguments: raise TypeError, 'No optional args expected'
 
151
        _arguments['----'] = _object
 
152
 
 
153
 
 
154
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
155
                _arguments, _attributes)
 
156
        if _arguments.get('errn', 0):
 
157
            raise aetools.Error, aetools.decodeerror(_arguments)
 
158
        # XXXX Optionally decode result
 
159
        if _arguments.has_key('----'):
 
160
            return _arguments['----']
 
161
 
 
162
    _argmap_make = {
 
163
        'new' : 'kocl',
 
164
        'at' : 'insh',
 
165
        'to' : 'to  ',
 
166
        'with_properties' : 'prdt',
 
167
    }
 
168
 
 
169
    def make(self, _no_object=None, _attributes={}, **_arguments):
 
170
        """make: Make a new element
 
171
        Keyword argument new: the class of the new element
 
172
        Keyword argument at: the location at which to insert the element
 
173
        Keyword argument to: when creating an alias file, the original item to create an alias to or when creating a file viewer window, the target of the window
 
174
        Keyword argument with_properties: the initial values for the properties of the element
 
175
        Keyword argument _attributes: AppleEvent attribute dictionary
 
176
        Returns: to the new object(s)
 
177
        """
 
178
        _code = 'core'
 
179
        _subcode = 'crel'
 
180
 
 
181
        aetools.keysubst(_arguments, self._argmap_make)
 
182
        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
183
 
 
184
 
 
185
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
186
                _arguments, _attributes)
 
187
        if _arguments.get('errn', 0):
 
188
            raise aetools.Error, aetools.decodeerror(_arguments)
 
189
        # XXXX Optionally decode result
 
190
        if _arguments.has_key('----'):
 
191
            return _arguments['----']
 
192
 
 
193
    _argmap_move = {
 
194
        'to' : 'insh',
 
195
        'replacing' : 'alrp',
 
196
        'positioned_at' : 'mvpl',
 
197
        'routing_suppressed' : 'rout',
 
198
    }
 
199
 
 
200
    def move(self, _object, _attributes={}, **_arguments):
 
201
        """move: Move object(s) to a new location
 
202
        Required argument: the object(s) to move
 
203
        Keyword argument to: the new location for the object(s)
 
204
        Keyword argument replacing: Specifies whether or not to replace items in the destination that have the same name as items being moved
 
205
        Keyword argument positioned_at: Gives a list (in local window coordinates) of positions for the destination items
 
206
        Keyword argument routing_suppressed: Specifies whether or not to autoroute items (default is false). Only applies when moving to the system folder.
 
207
        Keyword argument _attributes: AppleEvent attribute dictionary
 
208
        Returns: to the object(s) after they have been moved
 
209
        """
 
210
        _code = 'core'
 
211
        _subcode = 'move'
 
212
 
 
213
        aetools.keysubst(_arguments, self._argmap_move)
 
214
        _arguments['----'] = _object
 
215
 
 
216
        aetools.enumsubst(_arguments, 'alrp', _Enum_bool)
 
217
        aetools.enumsubst(_arguments, 'mvpl', _Enum_list)
 
218
        aetools.enumsubst(_arguments, 'rout', _Enum_bool)
 
219
 
 
220
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
221
                _arguments, _attributes)
 
222
        if _arguments.get('errn', 0):
 
223
            raise aetools.Error, aetools.decodeerror(_arguments)
 
224
        # XXXX Optionally decode result
 
225
        if _arguments.has_key('----'):
 
226
            return _arguments['----']
 
227
 
 
228
    _argmap_open = {
 
229
        'using' : 'usin',
 
230
        'with_properties' : 'prdt',
 
231
    }
 
232
 
 
233
    def open(self, _object, _attributes={}, **_arguments):
 
234
        """open: Open the specified object(s)
 
235
        Required argument: list of objects to open
 
236
        Keyword argument using: the application file to open the object with
 
237
        Keyword argument with_properties: the initial values for the properties, to be included with the open command sent to the application that opens the direct object
 
238
        Keyword argument _attributes: AppleEvent attribute dictionary
 
239
        """
 
240
        _code = 'aevt'
 
241
        _subcode = 'odoc'
 
242
 
 
243
        aetools.keysubst(_arguments, self._argmap_open)
 
244
        _arguments['----'] = _object
 
245
 
 
246
 
 
247
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
248
                _arguments, _attributes)
 
249
        if _arguments.get('errn', 0):
 
250
            raise aetools.Error, aetools.decodeerror(_arguments)
 
251
        # XXXX Optionally decode result
 
252
        if _arguments.has_key('----'):
 
253
            return _arguments['----']
 
254
 
 
255
    _argmap_print_ = {
 
256
        'with_properties' : 'prdt',
 
257
    }
 
258
 
 
259
    def print_(self, _object, _attributes={}, **_arguments):
 
260
        """print: Print the specified object(s)
 
261
        Required argument: list of objects to print
 
262
        Keyword argument with_properties: optional properties to be included with the print command sent to the application that prints the direct object
 
263
        Keyword argument _attributes: AppleEvent attribute dictionary
 
264
        """
 
265
        _code = 'aevt'
 
266
        _subcode = 'pdoc'
 
267
 
 
268
        aetools.keysubst(_arguments, self._argmap_print_)
 
269
        _arguments['----'] = _object
 
270
 
 
271
 
 
272
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
273
                _arguments, _attributes)
 
274
        if _arguments.get('errn', 0):
 
275
            raise aetools.Error, aetools.decodeerror(_arguments)
 
276
        # XXXX Optionally decode result
 
277
        if _arguments.has_key('----'):
 
278
            return _arguments['----']
 
279
 
 
280
    def quit(self, _no_object=None, _attributes={}, **_arguments):
 
281
        """quit: Quit the Finder
 
282
        Keyword argument _attributes: AppleEvent attribute dictionary
 
283
        """
 
284
        _code = 'aevt'
 
285
        _subcode = 'quit'
 
286
 
 
287
        if _arguments: raise TypeError, 'No optional args expected'
 
288
        if _no_object is not None: raise TypeError, 'No direct arg expected'
 
289
 
 
290
 
 
291
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
292
                _arguments, _attributes)
 
293
        if _arguments.get('errn', 0):
 
294
            raise aetools.Error, aetools.decodeerror(_arguments)
 
295
        # XXXX Optionally decode result
 
296
        if _arguments.has_key('----'):
 
297
            return _arguments['----']
 
298
 
 
299
    def select(self, _object, _attributes={}, **_arguments):
 
300
        """select: Select the specified object(s)
 
301
        Required argument: the object to select
 
302
        Keyword argument _attributes: AppleEvent attribute dictionary
 
303
        """
 
304
        _code = 'misc'
 
305
        _subcode = 'slct'
 
306
 
 
307
        if _arguments: raise TypeError, 'No optional args expected'
 
308
        _arguments['----'] = _object
 
309
 
 
310
 
 
311
        _reply, _arguments, _attributes = self.send(_code, _subcode,
 
312
                _arguments, _attributes)
 
313
        if _arguments.get('errn', 0):
 
314
            raise aetools.Error, aetools.decodeerror(_arguments)
 
315
        # XXXX Optionally decode result
 
316
        if _arguments.has_key('----'):
 
317
            return _arguments['----']
 
318
 
 
319
_Enum_list = None # XXXX enum list not found!!
 
320
_Enum_bool = None # XXXX enum bool not found!!
 
321
 
 
322
#
 
323
# Indices of types declared in this module
 
324
#
 
325
_classdeclarations = {
 
326
}
 
327
 
 
328
_propdeclarations = {
 
329
}
 
330
 
 
331
_compdeclarations = {
 
332
}
 
333
 
 
334
_enumdeclarations = {
 
335
}