ยปCore Development>Code coverage>Lib/plat-mac/lib-scriptpackages/SystemEvents/Power_Suite.py

Python code coverage for Lib/plat-mac/lib-scriptpackages/SystemEvents/Power_Suite.py

#countcontent
1n/a"""Suite Power Suite: Terms and Events for controlling System power
2n/aLevel 1, version 1
3n/a
4n/aGenerated from /System/Library/CoreServices/System Events.app
5n/aAETE/AEUT resource version 1/0, language 0, script 0
6n/a"""
7n/a
8n/aimport aetools
9n/aimport MacOS
10n/a
11n/a_code = 'powr'
12n/a
13n/aclass Power_Suite_Events:
14n/a
15n/a def restart(self, _object, _attributes={}, **_arguments):
16n/a """restart: Restart the computer
17n/a Required argument: the object for the command
18n/a Keyword argument _attributes: AppleEvent attribute dictionary
19n/a """
20n/a _code = 'fndr'
21n/a _subcode = 'rest'
22n/a
23n/a if _arguments: raise TypeError, 'No optional args expected'
24n/a _arguments['----'] = _object
25n/a
26n/a
27n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
28n/a _arguments, _attributes)
29n/a if _arguments.get('errn', 0):
30n/a raise aetools.Error, aetools.decodeerror(_arguments)
31n/a # XXXX Optionally decode result
32n/a if _arguments.has_key('----'):
33n/a return _arguments['----']
34n/a
35n/a def shut_down(self, _object, _attributes={}, **_arguments):
36n/a """shut down: Shut Down the computer
37n/a Required argument: the object for the command
38n/a Keyword argument _attributes: AppleEvent attribute dictionary
39n/a """
40n/a _code = 'fndr'
41n/a _subcode = 'shut'
42n/a
43n/a if _arguments: raise TypeError, 'No optional args expected'
44n/a _arguments['----'] = _object
45n/a
46n/a
47n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
48n/a _arguments, _attributes)
49n/a if _arguments.get('errn', 0):
50n/a raise aetools.Error, aetools.decodeerror(_arguments)
51n/a # XXXX Optionally decode result
52n/a if _arguments.has_key('----'):
53n/a return _arguments['----']
54n/a
55n/a def sleep(self, _object, _attributes={}, **_arguments):
56n/a """sleep: Put the computer to sleep
57n/a Required argument: the object for the command
58n/a Keyword argument _attributes: AppleEvent attribute dictionary
59n/a """
60n/a _code = 'fndr'
61n/a _subcode = 'slep'
62n/a
63n/a if _arguments: raise TypeError, 'No optional args expected'
64n/a _arguments['----'] = _object
65n/a
66n/a
67n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
68n/a _arguments, _attributes)
69n/a if _arguments.get('errn', 0):
70n/a raise aetools.Error, aetools.decodeerror(_arguments)
71n/a # XXXX Optionally decode result
72n/a if _arguments.has_key('----'):
73n/a return _arguments['----']
74n/a
75n/a
76n/aclass application(aetools.ComponentItem):
77n/a """application - The System Events application """
78n/a want = 'capp'
79n/aclass _Prop__3c_Inheritance_3e_(aetools.NProperty):
80n/a """<Inheritance> - All of the properties of the superclass. """
81n/a which = 'c@#^'
82n/a want = 'capp'
83n/a_3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_()
84n/aclass _Prop_folder_actions_enabled(aetools.NProperty):
85n/a """folder actions enabled - Are Folder Actions currently being processed? """
86n/a which = 'faen'
87n/a want = 'bool'
88n/afolder_actions_enabled = _Prop_folder_actions_enabled()
89n/aclass _Prop_properties(aetools.NProperty):
90n/a """properties - every property of the System Events application """
91n/a which = 'pALL'
92n/a want = '****'
93n/aproperties = _Prop_properties()
94n/a# element 'cdis' as ['name', 'indx', 'rele', 'rang', 'test']
95n/a# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test']
96n/a# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test']
97n/a# element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID ']
98n/a# element 'docu' as ['name', 'indx', 'rele', 'rang', 'test']
99n/a# element 'file' as ['name', 'indx', 'rele', 'rang', 'test']
100n/a# element 'foac' as ['name', 'indx', 'rele', 'rang', 'test']
101n/a# element 'logi' as ['name', 'indx', 'rele', 'rang', 'test']
102n/a# element 'pcap' as ['name', 'indx', 'rele', 'rang', 'test']
103n/a# element 'pcda' as ['name', 'indx', 'rele', 'rang', 'test']
104n/a# element 'prcs' as ['name', 'indx', 'rele', 'rang', 'test']
105n/a
106n/aapplications = application
107n/aapplication._superclassnames = []
108n/aimport Disk_Folder_File_Suite
109n/aimport Standard_Suite
110n/aimport Folder_Actions_Suite
111n/aimport Login_Items_Suite
112n/aimport Processes_Suite
113n/aapplication._privpropdict = {
114n/a '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
115n/a 'folder_actions_enabled' : _Prop_folder_actions_enabled,
116n/a 'properties' : _Prop_properties,
117n/a}
118n/aapplication._privelemdict = {
119n/a 'application_process' : Processes_Suite.application_process,
120n/a 'desk_accessory_process' : Processes_Suite.desk_accessory_process,
121n/a 'disk' : Disk_Folder_File_Suite.disk,
122n/a 'document' : Standard_Suite.document,
123n/a 'file' : Disk_Folder_File_Suite.file,
124n/a 'folder' : Disk_Folder_File_Suite.folder,
125n/a 'folder_action' : Folder_Actions_Suite.folder_action,
126n/a 'item' : Disk_Folder_File_Suite.item,
127n/a 'login_item' : Login_Items_Suite.login_item,
128n/a 'process' : Processes_Suite.process,
129n/a 'window' : Standard_Suite.window,
130n/a}
131n/a
132n/a#
133n/a# Indices of types declared in this module
134n/a#
135n/a_classdeclarations = {
136n/a 'capp' : application,
137n/a}
138n/a
139n/a_propdeclarations = {
140n/a 'c@#^' : _Prop__3c_Inheritance_3e_,
141n/a 'faen' : _Prop_folder_actions_enabled,
142n/a 'pALL' : _Prop_properties,
143n/a}
144n/a
145n/a_compdeclarations = {
146n/a}
147n/a
148n/a_enumdeclarations = {
149n/a}