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