/Lib/plat-mac/lib-scriptpackages/Finder/Legacy_suite.py

http://unladen-swallow.googlecode.com/ · Python · 224 lines · 166 code · 24 blank · 34 comment · 13 complexity · 3e54e32a40a94df8eb3b9a46f929f3d5 MD5 · raw file

  1. """Suite Legacy suite: Operations formerly handled by the Finder, but now automatically delegated to other applications
  2. Level 1, version 1
  3. Generated from /System/Library/CoreServices/Finder.app
  4. AETE/AEUT resource version 0/144, language 0, script 0
  5. """
  6. import aetools
  7. import MacOS
  8. _code = 'fleg'
  9. class Legacy_suite_Events:
  10. def restart(self, _no_object=None, _attributes={}, **_arguments):
  11. """restart: Restart the computer
  12. Keyword argument _attributes: AppleEvent attribute dictionary
  13. """
  14. _code = 'fndr'
  15. _subcode = 'rest'
  16. if _arguments: raise TypeError, 'No optional args expected'
  17. if _no_object is not None: raise TypeError, 'No direct arg expected'
  18. _reply, _arguments, _attributes = self.send(_code, _subcode,
  19. _arguments, _attributes)
  20. if _arguments.get('errn', 0):
  21. raise aetools.Error, aetools.decodeerror(_arguments)
  22. # XXXX Optionally decode result
  23. if _arguments.has_key('----'):
  24. return _arguments['----']
  25. def shut_down(self, _no_object=None, _attributes={}, **_arguments):
  26. """shut down: Shut Down the computer
  27. Keyword argument _attributes: AppleEvent attribute dictionary
  28. """
  29. _code = 'fndr'
  30. _subcode = 'shut'
  31. if _arguments: raise TypeError, 'No optional args expected'
  32. if _no_object is not None: raise TypeError, 'No direct arg expected'
  33. _reply, _arguments, _attributes = self.send(_code, _subcode,
  34. _arguments, _attributes)
  35. if _arguments.get('errn', 0):
  36. raise aetools.Error, aetools.decodeerror(_arguments)
  37. # XXXX Optionally decode result
  38. if _arguments.has_key('----'):
  39. return _arguments['----']
  40. def sleep(self, _no_object=None, _attributes={}, **_arguments):
  41. """sleep: Put the computer to sleep
  42. Keyword argument _attributes: AppleEvent attribute dictionary
  43. """
  44. _code = 'fndr'
  45. _subcode = 'slep'
  46. if _arguments: raise TypeError, 'No optional args expected'
  47. if _no_object is not None: raise TypeError, 'No direct arg expected'
  48. _reply, _arguments, _attributes = self.send(_code, _subcode,
  49. _arguments, _attributes)
  50. if _arguments.get('errn', 0):
  51. raise aetools.Error, aetools.decodeerror(_arguments)
  52. # XXXX Optionally decode result
  53. if _arguments.has_key('----'):
  54. return _arguments['----']
  55. class application(aetools.ComponentItem):
  56. """application - The Finder """
  57. want = 'capp'
  58. class _Prop_desktop_picture(aetools.NProperty):
  59. """desktop picture - the desktop picture of the main monitor """
  60. which = 'dpic'
  61. want = 'file'
  62. desktop_picture = _Prop_desktop_picture()
  63. class application_process(aetools.ComponentItem):
  64. """application process - A process launched from an application file """
  65. want = 'pcap'
  66. class _Prop__3c_Inheritance_3e_(aetools.NProperty):
  67. """<Inheritance> - inherits some of its properties from the process class """
  68. which = 'c@#^'
  69. want = 'prcs'
  70. class _Prop_application_file(aetools.NProperty):
  71. """application file - the application file from which this process was launched """
  72. which = 'appf'
  73. want = 'appf'
  74. application_processes = application_process
  75. class desk_accessory_process(aetools.ComponentItem):
  76. """desk accessory process - A process launched from a desk accessory file """
  77. want = 'pcda'
  78. class _Prop_desk_accessory_file(aetools.NProperty):
  79. """desk accessory file - the desk accessory file from which this process was launched """
  80. which = 'dafi'
  81. want = 'obj '
  82. desk_accessory_processes = desk_accessory_process
  83. class process(aetools.ComponentItem):
  84. """process - A process running on this computer """
  85. want = 'prcs'
  86. class _Prop_accepts_high_level_events(aetools.NProperty):
  87. """accepts high level events - Is the process high-level event aware (accepts open application, open document, print document, and quit)? """
  88. which = 'isab'
  89. want = 'bool'
  90. class _Prop_accepts_remote_events(aetools.NProperty):
  91. """accepts remote events - Does the process accept remote events? """
  92. which = 'revt'
  93. want = 'bool'
  94. class _Prop_creator_type(aetools.NProperty):
  95. """creator type - the OSType of the creator of the process (the signature) """
  96. which = 'fcrt'
  97. want = 'type'
  98. class _Prop_file(aetools.NProperty):
  99. """file - the file from which the process was launched """
  100. which = 'file'
  101. want = 'obj '
  102. class _Prop_file_type(aetools.NProperty):
  103. """file type - the OSType of the file type of the process """
  104. which = 'asty'
  105. want = 'type'
  106. class _Prop_frontmost(aetools.NProperty):
  107. """frontmost - Is the process the frontmost process? """
  108. which = 'pisf'
  109. want = 'bool'
  110. class _Prop_has_scripting_terminology(aetools.NProperty):
  111. """has scripting terminology - Does the process have a scripting terminology, i.e., can it be scripted? """
  112. which = 'hscr'
  113. want = 'bool'
  114. class _Prop_name(aetools.NProperty):
  115. """name - the name of the process """
  116. which = 'pnam'
  117. want = 'itxt'
  118. class _Prop_partition_space_used(aetools.NProperty):
  119. """partition space used - the number of bytes currently used in the process' partition """
  120. which = 'pusd'
  121. want = 'long'
  122. class _Prop_total_partition_size(aetools.NProperty):
  123. """total partition size - the size of the partition with which the process was launched """
  124. which = 'appt'
  125. want = 'long'
  126. class _Prop_visible(aetools.NProperty):
  127. """visible - Is the process' layer visible? """
  128. which = 'pvis'
  129. want = 'bool'
  130. processes = process
  131. application._superclassnames = []
  132. application._privpropdict = {
  133. 'desktop_picture' : _Prop_desktop_picture,
  134. }
  135. application._privelemdict = {
  136. }
  137. application_process._superclassnames = ['process']
  138. application_process._privpropdict = {
  139. '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
  140. 'application_file' : _Prop_application_file,
  141. }
  142. application_process._privelemdict = {
  143. }
  144. desk_accessory_process._superclassnames = ['process']
  145. desk_accessory_process._privpropdict = {
  146. '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_,
  147. 'desk_accessory_file' : _Prop_desk_accessory_file,
  148. }
  149. desk_accessory_process._privelemdict = {
  150. }
  151. process._superclassnames = []
  152. process._privpropdict = {
  153. 'accepts_high_level_events' : _Prop_accepts_high_level_events,
  154. 'accepts_remote_events' : _Prop_accepts_remote_events,
  155. 'creator_type' : _Prop_creator_type,
  156. 'file' : _Prop_file,
  157. 'file_type' : _Prop_file_type,
  158. 'frontmost' : _Prop_frontmost,
  159. 'has_scripting_terminology' : _Prop_has_scripting_terminology,
  160. 'name' : _Prop_name,
  161. 'partition_space_used' : _Prop_partition_space_used,
  162. 'total_partition_size' : _Prop_total_partition_size,
  163. 'visible' : _Prop_visible,
  164. }
  165. process._privelemdict = {
  166. }
  167. #
  168. # Indices of types declared in this module
  169. #
  170. _classdeclarations = {
  171. 'capp' : application,
  172. 'pcap' : application_process,
  173. 'pcda' : desk_accessory_process,
  174. 'prcs' : process,
  175. }
  176. _propdeclarations = {
  177. 'appf' : _Prop_application_file,
  178. 'appt' : _Prop_total_partition_size,
  179. 'asty' : _Prop_file_type,
  180. 'c@#^' : _Prop__3c_Inheritance_3e_,
  181. 'dafi' : _Prop_desk_accessory_file,
  182. 'dpic' : _Prop_desktop_picture,
  183. 'fcrt' : _Prop_creator_type,
  184. 'file' : _Prop_file,
  185. 'hscr' : _Prop_has_scripting_terminology,
  186. 'isab' : _Prop_accepts_high_level_events,
  187. 'pisf' : _Prop_frontmost,
  188. 'pnam' : _Prop_name,
  189. 'pusd' : _Prop_partition_space_used,
  190. 'pvis' : _Prop_visible,
  191. 'revt' : _Prop_accepts_remote_events,
  192. }
  193. _compdeclarations = {
  194. }
  195. _enumdeclarations = {
  196. }