PageRenderTime 49ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://bitbucket.org/dac_io/pypy
Python | 355 lines | 267 code | 35 blank | 53 comment | 19 complexity | e4f4adc2f5374be32d67429dbfb4d6db MD5 | raw file
  1. """Suite Finder items: Commands used with file system items, and basic item definition
  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 = 'fndr'
  9. class Finder_items_Events:
  10. def add_to_favorites(self, _object, _attributes={}, **_arguments):
  11. """add to favorites: (NOT AVAILABLE YET) Add the items to the user\xd5s Favorites
  12. Required argument: the items to add to the collection of Favorites
  13. Keyword argument _attributes: AppleEvent attribute dictionary
  14. """
  15. _code = 'fndr'
  16. _subcode = 'ffav'
  17. if _arguments: raise TypeError, 'No optional args expected'
  18. _arguments['----'] = _object
  19. _reply, _arguments, _attributes = self.send(_code, _subcode,
  20. _arguments, _attributes)
  21. if _arguments.get('errn', 0):
  22. raise aetools.Error, aetools.decodeerror(_arguments)
  23. # XXXX Optionally decode result
  24. if _arguments.has_key('----'):
  25. return _arguments['----']
  26. _argmap_clean_up = {
  27. 'by' : 'by ',
  28. }
  29. def clean_up(self, _object, _attributes={}, **_arguments):
  30. """clean up: (NOT AVAILABLE YET) Arrange items in window nicely (only applies to open windows in icon view that are not kept arranged)
  31. Required argument: the window to clean up
  32. Keyword argument by: the order in which to clean up the objects (name, index, date, etc.)
  33. Keyword argument _attributes: AppleEvent attribute dictionary
  34. """
  35. _code = 'fndr'
  36. _subcode = 'fclu'
  37. aetools.keysubst(_arguments, self._argmap_clean_up)
  38. _arguments['----'] = _object
  39. _reply, _arguments, _attributes = self.send(_code, _subcode,
  40. _arguments, _attributes)
  41. if _arguments.get('errn', 0):
  42. raise aetools.Error, aetools.decodeerror(_arguments)
  43. # XXXX Optionally decode result
  44. if _arguments.has_key('----'):
  45. return _arguments['----']
  46. def eject(self, _object=None, _attributes={}, **_arguments):
  47. """eject: Eject the specified disk(s)
  48. Required argument: the disk(s) to eject
  49. Keyword argument _attributes: AppleEvent attribute dictionary
  50. """
  51. _code = 'fndr'
  52. _subcode = 'ejct'
  53. if _arguments: raise TypeError, 'No optional args expected'
  54. _arguments['----'] = _object
  55. _reply, _arguments, _attributes = self.send(_code, _subcode,
  56. _arguments, _attributes)
  57. if _arguments.get('errn', 0):
  58. raise aetools.Error, aetools.decodeerror(_arguments)
  59. # XXXX Optionally decode result
  60. if _arguments.has_key('----'):
  61. return _arguments['----']
  62. def empty(self, _object=None, _attributes={}, **_arguments):
  63. """empty: Empty the trash
  64. Required argument: \xd2empty\xd3 and \xd2empty trash\xd3 both do the same thing
  65. Keyword argument _attributes: AppleEvent attribute dictionary
  66. """
  67. _code = 'fndr'
  68. _subcode = 'empt'
  69. if _arguments: raise TypeError, 'No optional args expected'
  70. _arguments['----'] = _object
  71. _reply, _arguments, _attributes = self.send(_code, _subcode,
  72. _arguments, _attributes)
  73. if _arguments.get('errn', 0):
  74. raise aetools.Error, aetools.decodeerror(_arguments)
  75. # XXXX Optionally decode result
  76. if _arguments.has_key('----'):
  77. return _arguments['----']
  78. def erase(self, _object, _attributes={}, **_arguments):
  79. """erase: (NOT AVAILABLE) Erase the specified disk(s)
  80. Required argument: the items to erase
  81. Keyword argument _attributes: AppleEvent attribute dictionary
  82. """
  83. _code = 'fndr'
  84. _subcode = 'fera'
  85. if _arguments: raise TypeError, 'No optional args expected'
  86. _arguments['----'] = _object
  87. _reply, _arguments, _attributes = self.send(_code, _subcode,
  88. _arguments, _attributes)
  89. if _arguments.get('errn', 0):
  90. raise aetools.Error, aetools.decodeerror(_arguments)
  91. # XXXX Optionally decode result
  92. if _arguments.has_key('----'):
  93. return _arguments['----']
  94. def reveal(self, _object, _attributes={}, **_arguments):
  95. """reveal: Bring the specified object(s) into view
  96. Required argument: the object to be made visible
  97. Keyword argument _attributes: AppleEvent attribute dictionary
  98. """
  99. _code = 'misc'
  100. _subcode = 'mvis'
  101. if _arguments: raise TypeError, 'No optional args expected'
  102. _arguments['----'] = _object
  103. _reply, _arguments, _attributes = self.send(_code, _subcode,
  104. _arguments, _attributes)
  105. if _arguments.get('errn', 0):
  106. raise aetools.Error, aetools.decodeerror(_arguments)
  107. # XXXX Optionally decode result
  108. if _arguments.has_key('----'):
  109. return _arguments['----']
  110. _argmap_update = {
  111. 'necessity' : 'nec?',
  112. 'registering_applications' : 'reg?',
  113. }
  114. def update(self, _object, _attributes={}, **_arguments):
  115. """update: Update the display of the specified object(s) to match their on-disk representation
  116. Required argument: the item to update
  117. Keyword argument necessity: only update if necessary (i.e. a finder window is open). default is false
  118. Keyword argument registering_applications: register applications. default is true
  119. Keyword argument _attributes: AppleEvent attribute dictionary
  120. """
  121. _code = 'fndr'
  122. _subcode = 'fupd'
  123. aetools.keysubst(_arguments, self._argmap_update)
  124. _arguments['----'] = _object
  125. _reply, _arguments, _attributes = self.send(_code, _subcode,
  126. _arguments, _attributes)
  127. if _arguments.get('errn', 0):
  128. raise aetools.Error, aetools.decodeerror(_arguments)
  129. # XXXX Optionally decode result
  130. if _arguments.has_key('----'):
  131. return _arguments['----']
  132. class item(aetools.ComponentItem):
  133. """item - An item """
  134. want = 'cobj'
  135. class _Prop_bounds(aetools.NProperty):
  136. """bounds - the bounding rectangle of the item (can only be set for an item in a window viewed as icons or buttons) """
  137. which = 'pbnd'
  138. want = 'qdrt'
  139. class _Prop_comment(aetools.NProperty):
  140. """comment - the comment of the item, displayed in the \xd2Get Info\xd3 window """
  141. which = 'comt'
  142. want = 'utxt'
  143. class _Prop_container(aetools.NProperty):
  144. """container - the container of the item """
  145. which = 'ctnr'
  146. want = 'obj '
  147. class _Prop_creation_date(aetools.NProperty):
  148. """creation date - the date on which the item was created """
  149. which = 'ascd'
  150. want = 'ldt '
  151. class _Prop_description(aetools.NProperty):
  152. """description - a description of the item """
  153. which = 'dscr'
  154. want = 'utxt'
  155. class _Prop_disk(aetools.NProperty):
  156. """disk - the disk on which the item is stored """
  157. which = 'cdis'
  158. want = 'obj '
  159. class _Prop_displayed_name(aetools.NProperty):
  160. """displayed name - the user-visible name of the item """
  161. which = 'dnam'
  162. want = 'utxt'
  163. class _Prop_everyones_privileges(aetools.NProperty):
  164. """everyones privileges - """
  165. which = 'gstp'
  166. want = 'priv'
  167. class _Prop_extension_hidden(aetools.NProperty):
  168. """extension hidden - Is the item's extension hidden from the user? """
  169. which = 'hidx'
  170. want = 'bool'
  171. class _Prop_group(aetools.NProperty):
  172. """group - the user or group that has special access to the container """
  173. which = 'sgrp'
  174. want = 'utxt'
  175. class _Prop_group_privileges(aetools.NProperty):
  176. """group privileges - """
  177. which = 'gppr'
  178. want = 'priv'
  179. class _Prop_icon(aetools.NProperty):
  180. """icon - the icon bitmap of the item """
  181. which = 'iimg'
  182. want = 'ifam'
  183. class _Prop_index(aetools.NProperty):
  184. """index - the index in the front-to-back ordering within its container """
  185. which = 'pidx'
  186. want = 'long'
  187. class _Prop_information_window(aetools.NProperty):
  188. """information window - the information window for the item """
  189. which = 'iwnd'
  190. want = 'obj '
  191. class _Prop_kind(aetools.NProperty):
  192. """kind - the kind of the item """
  193. which = 'kind'
  194. want = 'utxt'
  195. class _Prop_label_index(aetools.NProperty):
  196. """label index - the label of the item """
  197. which = 'labi'
  198. want = 'long'
  199. class _Prop_locked(aetools.NProperty):
  200. """locked - Is the file locked? """
  201. which = 'aslk'
  202. want = 'bool'
  203. class _Prop_modification_date(aetools.NProperty):
  204. """modification date - the date on which the item was last modified """
  205. which = 'asmo'
  206. want = 'ldt '
  207. class _Prop_name(aetools.NProperty):
  208. """name - the name of the item """
  209. which = 'pnam'
  210. want = 'utxt'
  211. class _Prop_name_extension(aetools.NProperty):
  212. """name extension - the name extension of the item (such as \xd2txt\xd3) """
  213. which = 'nmxt'
  214. want = 'utxt'
  215. class _Prop_owner(aetools.NProperty):
  216. """owner - the user that owns the container """
  217. which = 'sown'
  218. want = 'utxt'
  219. class _Prop_owner_privileges(aetools.NProperty):
  220. """owner privileges - """
  221. which = 'ownr'
  222. want = 'priv'
  223. class _Prop_physical_size(aetools.NProperty):
  224. """physical size - the actual space used by the item on disk """
  225. which = 'phys'
  226. want = 'comp'
  227. class _Prop_position(aetools.NProperty):
  228. """position - the position of the item within its parent window (can only be set for an item in a window viewed as icons or buttons) """
  229. which = 'posn'
  230. want = 'QDpt'
  231. class _Prop_properties(aetools.NProperty):
  232. """properties - every property of an item """
  233. which = 'pALL'
  234. want = 'reco'
  235. class _Prop_size(aetools.NProperty):
  236. """size - the logical size of the item """
  237. which = 'ptsz'
  238. want = 'comp'
  239. class _Prop_url(aetools.NProperty):
  240. """url - the url of the item """
  241. which = 'pURL'
  242. want = 'utxt'
  243. items = item
  244. item._superclassnames = []
  245. item._privpropdict = {
  246. 'bounds' : _Prop_bounds,
  247. 'comment' : _Prop_comment,
  248. 'container' : _Prop_container,
  249. 'creation_date' : _Prop_creation_date,
  250. 'description' : _Prop_description,
  251. 'disk' : _Prop_disk,
  252. 'displayed_name' : _Prop_displayed_name,
  253. 'everyones_privileges' : _Prop_everyones_privileges,
  254. 'extension_hidden' : _Prop_extension_hidden,
  255. 'group' : _Prop_group,
  256. 'group_privileges' : _Prop_group_privileges,
  257. 'icon' : _Prop_icon,
  258. 'index' : _Prop_index,
  259. 'information_window' : _Prop_information_window,
  260. 'kind' : _Prop_kind,
  261. 'label_index' : _Prop_label_index,
  262. 'locked' : _Prop_locked,
  263. 'modification_date' : _Prop_modification_date,
  264. 'name' : _Prop_name,
  265. 'name_extension' : _Prop_name_extension,
  266. 'owner' : _Prop_owner,
  267. 'owner_privileges' : _Prop_owner_privileges,
  268. 'physical_size' : _Prop_physical_size,
  269. 'position' : _Prop_position,
  270. 'properties' : _Prop_properties,
  271. 'size' : _Prop_size,
  272. 'url' : _Prop_url,
  273. }
  274. item._privelemdict = {
  275. }
  276. #
  277. # Indices of types declared in this module
  278. #
  279. _classdeclarations = {
  280. 'cobj' : item,
  281. }
  282. _propdeclarations = {
  283. 'ascd' : _Prop_creation_date,
  284. 'aslk' : _Prop_locked,
  285. 'asmo' : _Prop_modification_date,
  286. 'cdis' : _Prop_disk,
  287. 'comt' : _Prop_comment,
  288. 'ctnr' : _Prop_container,
  289. 'dnam' : _Prop_displayed_name,
  290. 'dscr' : _Prop_description,
  291. 'gppr' : _Prop_group_privileges,
  292. 'gstp' : _Prop_everyones_privileges,
  293. 'hidx' : _Prop_extension_hidden,
  294. 'iimg' : _Prop_icon,
  295. 'iwnd' : _Prop_information_window,
  296. 'kind' : _Prop_kind,
  297. 'labi' : _Prop_label_index,
  298. 'nmxt' : _Prop_name_extension,
  299. 'ownr' : _Prop_owner_privileges,
  300. 'pALL' : _Prop_properties,
  301. 'pURL' : _Prop_url,
  302. 'pbnd' : _Prop_bounds,
  303. 'phys' : _Prop_physical_size,
  304. 'pidx' : _Prop_index,
  305. 'pnam' : _Prop_name,
  306. 'posn' : _Prop_position,
  307. 'ptsz' : _Prop_size,
  308. 'sgrp' : _Prop_group,
  309. 'sown' : _Prop_owner,
  310. }
  311. _compdeclarations = {
  312. }
  313. _enumdeclarations = {
  314. }