1 """Suite builtin_Suite: Every application supports open, reopen, print, run, and quit
10 class builtin_Suite_Events
:
12 def open(self
, _object
, _attributes
={}, **_arguments
):
13 """open: Open the specified object(s)
14 Required argument: list of objects to open
15 Keyword argument _attributes: AppleEvent attribute dictionary
20 if _arguments
: raise TypeError, 'No optional args expected'
21 _arguments
['----'] = _object
24 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
25 _arguments
, _attributes
)
26 if _arguments
.get('errn', 0):
27 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
28 # XXXX Optionally decode result
29 if _arguments
.has_key('----'):
30 return _arguments
['----']
32 def run(self
, _no_object
=None, _attributes
={}, **_arguments
):
33 """run: Run an application. Most applications will open an empty, untitled window.
34 Keyword argument _attributes: AppleEvent attribute dictionary
39 if _arguments
: raise TypeError, 'No optional args expected'
40 if _no_object
!= None: raise TypeError, 'No direct arg expected'
43 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
44 _arguments
, _attributes
)
45 if _arguments
.get('errn', 0):
46 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
47 # XXXX Optionally decode result
48 if _arguments
.has_key('----'):
49 return _arguments
['----']
51 def reopen(self
, _no_object
=None, _attributes
={}, **_arguments
):
52 """reopen: Reactivate a running application. Some applications will open a new untitled window if no window is open.
53 Keyword argument _attributes: AppleEvent attribute dictionary
58 if _arguments
: raise TypeError, 'No optional args expected'
59 if _no_object
!= None: raise TypeError, 'No direct arg expected'
62 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
63 _arguments
, _attributes
)
64 if _arguments
.get('errn', 0):
65 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
66 # XXXX Optionally decode result
67 if _arguments
.has_key('----'):
68 return _arguments
['----']
70 def _print(self
, _object
, _attributes
={}, **_arguments
):
71 """print: Print the specified object(s)
72 Required argument: list of objects to print
73 Keyword argument _attributes: AppleEvent attribute dictionary
78 if _arguments
: raise TypeError, 'No optional args expected'
79 _arguments
['----'] = _object
82 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
83 _arguments
, _attributes
)
84 if _arguments
.get('errn', 0):
85 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
86 # XXXX Optionally decode result
87 if _arguments
.has_key('----'):
88 return _arguments
['----']
94 def quit(self
, _no_object
=None, _attributes
={}, **_arguments
):
95 """quit: Quit an application
96 Keyword argument saving: specifies whether to save currently open documents
97 Keyword argument _attributes: AppleEvent attribute dictionary
102 aetools
.keysubst(_arguments
, self
._argmap
_quit
)
103 if _no_object
!= None: raise TypeError, 'No direct arg expected'
105 aetools
.enumsubst(_arguments
, 'savo', _Enum_savo
)
107 _reply
, _arguments
, _attributes
= self
.send(_code
, _subcode
,
108 _arguments
, _attributes
)
109 if _arguments
.get('errn', 0):
110 raise aetools
.Error
, aetools
.decodeerror(_arguments
)
111 # XXXX Optionally decode result
112 if _arguments
.has_key('----'):
113 return _arguments
['----']
117 'saving_in' : 'kfil',
121 'yes' : 'yes ', # Save objects now
122 'no' : 'no ', # Do not save objects
123 'ask' : 'ask ', # Ask the user whether to save
127 # Indices of types declared in this module
129 _classdeclarations
= {
132 _propdeclarations
= {
135 _compdeclarations
= {
138 _enumdeclarations
= {