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