PageRenderTime 57ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/lib-python/2.7/plat-mac/lib-scriptpackages/Finder/Standard_Suite.py

https://bitbucket.org/dac_io/pypy
Python | 335 lines | 182 code | 63 blank | 90 comment | 31 complexity | 87503f0b8a003d8e3e9072c805c0241a MD5 | raw file
  1. """Suite Standard Suite: Common terms that most applications should support
  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 = 'CoRe'
  9. from StdSuites.Standard_Suite import *
  10. class Standard_Suite_Events(Standard_Suite_Events):
  11. def close(self, _object, _attributes={}, **_arguments):
  12. """close: Close an object
  13. Required argument: the object to close
  14. Keyword argument _attributes: AppleEvent attribute dictionary
  15. """
  16. _code = 'core'
  17. _subcode = 'clos'
  18. if _arguments: raise TypeError, 'No optional args expected'
  19. _arguments['----'] = _object
  20. _reply, _arguments, _attributes = self.send(_code, _subcode,
  21. _arguments, _attributes)
  22. if _arguments.get('errn', 0):
  23. raise aetools.Error, aetools.decodeerror(_arguments)
  24. # XXXX Optionally decode result
  25. if _arguments.has_key('----'):
  26. return _arguments['----']
  27. _argmap_count = {
  28. 'each' : 'kocl',
  29. }
  30. def count(self, _object, _attributes={}, **_arguments):
  31. """count: Return the number of elements of a particular class within an object
  32. Required argument: the object whose elements are to be counted
  33. Keyword argument each: the class of the elements to be counted
  34. Keyword argument _attributes: AppleEvent attribute dictionary
  35. Returns: the number of elements
  36. """
  37. _code = 'core'
  38. _subcode = 'cnte'
  39. aetools.keysubst(_arguments, self._argmap_count)
  40. _arguments['----'] = _object
  41. _reply, _arguments, _attributes = self.send(_code, _subcode,
  42. _arguments, _attributes)
  43. if _arguments.get('errn', 0):
  44. raise aetools.Error, aetools.decodeerror(_arguments)
  45. # XXXX Optionally decode result
  46. if _arguments.has_key('----'):
  47. return _arguments['----']
  48. _argmap_data_size = {
  49. 'as' : 'rtyp',
  50. }
  51. def data_size(self, _object, _attributes={}, **_arguments):
  52. """data size: Return the size in bytes of an object
  53. Required argument: the object whose data size is to be returned
  54. Keyword argument as: the data type for which the size is calculated
  55. Keyword argument _attributes: AppleEvent attribute dictionary
  56. Returns: the size of the object in bytes
  57. """
  58. _code = 'core'
  59. _subcode = 'dsiz'
  60. aetools.keysubst(_arguments, self._argmap_data_size)
  61. _arguments['----'] = _object
  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['----']
  69. def delete(self, _object, _attributes={}, **_arguments):
  70. """delete: Move an item from its container to the trash
  71. Required argument: the item to delete
  72. Keyword argument _attributes: AppleEvent attribute dictionary
  73. Returns: to the item that was just deleted
  74. """
  75. _code = 'core'
  76. _subcode = 'delo'
  77. if _arguments: raise TypeError, 'No optional args expected'
  78. _arguments['----'] = _object
  79. _reply, _arguments, _attributes = self.send(_code, _subcode,
  80. _arguments, _attributes)
  81. if _arguments.get('errn', 0):
  82. raise aetools.Error, aetools.decodeerror(_arguments)
  83. # XXXX Optionally decode result
  84. if _arguments.has_key('----'):
  85. return _arguments['----']
  86. _argmap_duplicate = {
  87. 'to' : 'insh',
  88. 'replacing' : 'alrp',
  89. 'routing_suppressed' : 'rout',
  90. }
  91. def duplicate(self, _object, _attributes={}, **_arguments):
  92. """duplicate: Duplicate one or more object(s)
  93. Required argument: the object(s) to duplicate
  94. Keyword argument to: the new location for the object(s)
  95. Keyword argument replacing: Specifies whether or not to replace items in the destination that have the same name as items being duplicated
  96. Keyword argument routing_suppressed: Specifies whether or not to autoroute items (default is false). Only applies when copying to the system folder.
  97. Keyword argument _attributes: AppleEvent attribute dictionary
  98. Returns: to the duplicated object(s)
  99. """
  100. _code = 'core'
  101. _subcode = 'clon'
  102. aetools.keysubst(_arguments, self._argmap_duplicate)
  103. _arguments['----'] = _object
  104. aetools.enumsubst(_arguments, 'alrp', _Enum_bool)
  105. aetools.enumsubst(_arguments, 'rout', _Enum_bool)
  106. _reply, _arguments, _attributes = self.send(_code, _subcode,
  107. _arguments, _attributes)
  108. if _arguments.get('errn', 0):
  109. raise aetools.Error, aetools.decodeerror(_arguments)
  110. # XXXX Optionally decode result
  111. if _arguments.has_key('----'):
  112. return _arguments['----']
  113. def exists(self, _object, _attributes={}, **_arguments):
  114. """exists: Verify if an object exists
  115. Required argument: the object in question
  116. Keyword argument _attributes: AppleEvent attribute dictionary
  117. Returns: true if it exists, false if not
  118. """
  119. _code = 'core'
  120. _subcode = 'doex'
  121. if _arguments: raise TypeError, 'No optional args expected'
  122. _arguments['----'] = _object
  123. _reply, _arguments, _attributes = self.send(_code, _subcode,
  124. _arguments, _attributes)
  125. if _arguments.get('errn', 0):
  126. raise aetools.Error, aetools.decodeerror(_arguments)
  127. # XXXX Optionally decode result
  128. if _arguments.has_key('----'):
  129. return _arguments['----']
  130. _argmap_make = {
  131. 'new' : 'kocl',
  132. 'at' : 'insh',
  133. 'to' : 'to ',
  134. 'with_properties' : 'prdt',
  135. }
  136. def make(self, _no_object=None, _attributes={}, **_arguments):
  137. """make: Make a new element
  138. Keyword argument new: the class of the new element
  139. Keyword argument at: the location at which to insert the element
  140. Keyword argument to: when creating an alias file, the original item to create an alias to or when creating a file viewer window, the target of the window
  141. Keyword argument with_properties: the initial values for the properties of the element
  142. Keyword argument _attributes: AppleEvent attribute dictionary
  143. Returns: to the new object(s)
  144. """
  145. _code = 'core'
  146. _subcode = 'crel'
  147. aetools.keysubst(_arguments, self._argmap_make)
  148. if _no_object is not None: raise TypeError, 'No direct arg expected'
  149. _reply, _arguments, _attributes = self.send(_code, _subcode,
  150. _arguments, _attributes)
  151. if _arguments.get('errn', 0):
  152. raise aetools.Error, aetools.decodeerror(_arguments)
  153. # XXXX Optionally decode result
  154. if _arguments.has_key('----'):
  155. return _arguments['----']
  156. _argmap_move = {
  157. 'to' : 'insh',
  158. 'replacing' : 'alrp',
  159. 'positioned_at' : 'mvpl',
  160. 'routing_suppressed' : 'rout',
  161. }
  162. def move(self, _object, _attributes={}, **_arguments):
  163. """move: Move object(s) to a new location
  164. Required argument: the object(s) to move
  165. Keyword argument to: the new location for the object(s)
  166. Keyword argument replacing: Specifies whether or not to replace items in the destination that have the same name as items being moved
  167. Keyword argument positioned_at: Gives a list (in local window coordinates) of positions for the destination items
  168. Keyword argument routing_suppressed: Specifies whether or not to autoroute items (default is false). Only applies when moving to the system folder.
  169. Keyword argument _attributes: AppleEvent attribute dictionary
  170. Returns: to the object(s) after they have been moved
  171. """
  172. _code = 'core'
  173. _subcode = 'move'
  174. aetools.keysubst(_arguments, self._argmap_move)
  175. _arguments['----'] = _object
  176. aetools.enumsubst(_arguments, 'alrp', _Enum_bool)
  177. aetools.enumsubst(_arguments, 'mvpl', _Enum_list)
  178. aetools.enumsubst(_arguments, 'rout', _Enum_bool)
  179. _reply, _arguments, _attributes = self.send(_code, _subcode,
  180. _arguments, _attributes)
  181. if _arguments.get('errn', 0):
  182. raise aetools.Error, aetools.decodeerror(_arguments)
  183. # XXXX Optionally decode result
  184. if _arguments.has_key('----'):
  185. return _arguments['----']
  186. _argmap_open = {
  187. 'using' : 'usin',
  188. 'with_properties' : 'prdt',
  189. }
  190. def open(self, _object, _attributes={}, **_arguments):
  191. """open: Open the specified object(s)
  192. Required argument: list of objects to open
  193. Keyword argument using: the application file to open the object with
  194. Keyword argument with_properties: the initial values for the properties, to be included with the open command sent to the application that opens the direct object
  195. Keyword argument _attributes: AppleEvent attribute dictionary
  196. """
  197. _code = 'aevt'
  198. _subcode = 'odoc'
  199. aetools.keysubst(_arguments, self._argmap_open)
  200. _arguments['----'] = _object
  201. _reply, _arguments, _attributes = self.send(_code, _subcode,
  202. _arguments, _attributes)
  203. if _arguments.get('errn', 0):
  204. raise aetools.Error, aetools.decodeerror(_arguments)
  205. # XXXX Optionally decode result
  206. if _arguments.has_key('----'):
  207. return _arguments['----']
  208. _argmap_print_ = {
  209. 'with_properties' : 'prdt',
  210. }
  211. def print_(self, _object, _attributes={}, **_arguments):
  212. """print: Print the specified object(s)
  213. Required argument: list of objects to print
  214. Keyword argument with_properties: optional properties to be included with the print command sent to the application that prints the direct object
  215. Keyword argument _attributes: AppleEvent attribute dictionary
  216. """
  217. _code = 'aevt'
  218. _subcode = 'pdoc'
  219. aetools.keysubst(_arguments, self._argmap_print_)
  220. _arguments['----'] = _object
  221. _reply, _arguments, _attributes = self.send(_code, _subcode,
  222. _arguments, _attributes)
  223. if _arguments.get('errn', 0):
  224. raise aetools.Error, aetools.decodeerror(_arguments)
  225. # XXXX Optionally decode result
  226. if _arguments.has_key('----'):
  227. return _arguments['----']
  228. def quit(self, _no_object=None, _attributes={}, **_arguments):
  229. """quit: Quit the Finder
  230. Keyword argument _attributes: AppleEvent attribute dictionary
  231. """
  232. _code = 'aevt'
  233. _subcode = 'quit'
  234. if _arguments: raise TypeError, 'No optional args expected'
  235. if _no_object is not None: raise TypeError, 'No direct arg expected'
  236. _reply, _arguments, _attributes = self.send(_code, _subcode,
  237. _arguments, _attributes)
  238. if _arguments.get('errn', 0):
  239. raise aetools.Error, aetools.decodeerror(_arguments)
  240. # XXXX Optionally decode result
  241. if _arguments.has_key('----'):
  242. return _arguments['----']
  243. def select(self, _object, _attributes={}, **_arguments):
  244. """select: Select the specified object(s)
  245. Required argument: the object to select
  246. Keyword argument _attributes: AppleEvent attribute dictionary
  247. """
  248. _code = 'misc'
  249. _subcode = 'slct'
  250. if _arguments: raise TypeError, 'No optional args expected'
  251. _arguments['----'] = _object
  252. _reply, _arguments, _attributes = self.send(_code, _subcode,
  253. _arguments, _attributes)
  254. if _arguments.get('errn', 0):
  255. raise aetools.Error, aetools.decodeerror(_arguments)
  256. # XXXX Optionally decode result
  257. if _arguments.has_key('----'):
  258. return _arguments['----']
  259. _Enum_list = None # XXXX enum list not found!!
  260. _Enum_bool = None # XXXX enum bool not found!!
  261. #
  262. # Indices of types declared in this module
  263. #
  264. _classdeclarations = {
  265. }
  266. _propdeclarations = {
  267. }
  268. _compdeclarations = {
  269. }
  270. _enumdeclarations = {
  271. }