/Mac/Tools/Doc/HelpIndexingTool/Standard_Suite.py

http://unladen-swallow.googlecode.com/ · Python · 343 lines · 217 code · 48 blank · 78 comment · 21 complexity · f3de0426d1bd8a21c380ca4dd47a047c MD5 · raw file

  1. """Suite Standard Suite: Common terms for most applications
  2. Level 1, version 1
  3. Generated from /Developer/Applications/Apple Help Indexing Tool.app
  4. AETE/AEUT resource version 1/1, 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. _argmap_close = {
  12. 'saving' : 'savo',
  13. 'in_' : 'kfil',
  14. }
  15. def close(self, _object, _attributes={}, **_arguments):
  16. """close: Close an object
  17. Required argument: the objects to close
  18. Keyword argument saving: specifies whether or not changes should be saved before closing
  19. Keyword argument in_: the file in which to save the object
  20. Keyword argument _attributes: AppleEvent attribute dictionary
  21. """
  22. _code = 'core'
  23. _subcode = 'clos'
  24. aetools.keysubst(_arguments, self._argmap_close)
  25. _arguments['----'] = _object
  26. aetools.enumsubst(_arguments, 'savo', _Enum_savo)
  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. def data_size(self, _object, _attributes={}, **_arguments):
  35. """data size: Return the size in bytes of an object
  36. Required argument: the object whose data size is to be returned
  37. Keyword argument _attributes: AppleEvent attribute dictionary
  38. Returns: the size of the object in bytes
  39. """
  40. _code = 'core'
  41. _subcode = 'dsiz'
  42. if _arguments: raise TypeError, 'No optional args expected'
  43. _arguments['----'] = _object
  44. _reply, _arguments, _attributes = self.send(_code, _subcode,
  45. _arguments, _attributes)
  46. if _arguments.get('errn', 0):
  47. raise aetools.Error, aetools.decodeerror(_arguments)
  48. # XXXX Optionally decode result
  49. if _arguments.has_key('----'):
  50. return _arguments['----']
  51. def get(self, _object, _attributes={}, **_arguments):
  52. """get: Get the data for an object
  53. Required argument: the object whose data is to be returned
  54. Keyword argument _attributes: AppleEvent attribute dictionary
  55. Returns: The data from the object
  56. """
  57. _code = 'core'
  58. _subcode = 'getd'
  59. if _arguments: raise TypeError, 'No optional args expected'
  60. _arguments['----'] = _object
  61. _reply, _arguments, _attributes = self.send(_code, _subcode,
  62. _arguments, _attributes)
  63. if _arguments.get('errn', 0):
  64. raise aetools.Error, aetools.decodeerror(_arguments)
  65. # XXXX Optionally decode result
  66. if _arguments.has_key('----'):
  67. return _arguments['----']
  68. _argmap_make = {
  69. 'new' : 'kocl',
  70. 'at' : 'insh',
  71. 'with_data' : 'data',
  72. 'with_properties' : 'prdt',
  73. }
  74. def make(self, _no_object=None, _attributes={}, **_arguments):
  75. """make: Make a new element
  76. Keyword argument new: the class of the new element
  77. Keyword argument at: the location at which to insert the element
  78. Keyword argument with_data: the initial data for the element
  79. Keyword argument with_properties: the initial values for the properties of the element
  80. Keyword argument _attributes: AppleEvent attribute dictionary
  81. Returns: Object specifier for the new element
  82. """
  83. _code = 'core'
  84. _subcode = 'crel'
  85. aetools.keysubst(_arguments, self._argmap_make)
  86. if _no_object is not None: raise TypeError, 'No direct arg expected'
  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 open(self, _object, _attributes={}, **_arguments):
  95. """open: Open the specified object(s)
  96. Required argument: Objects to open. Can be a list of files or an object specifier.
  97. Keyword argument _attributes: AppleEvent attribute dictionary
  98. """
  99. _code = 'aevt'
  100. _subcode = 'odoc'
  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. def print_(self, _object, _attributes={}, **_arguments):
  111. """print: Print the specified object(s)
  112. Required argument: Objects to print. Can be a list of files or an object specifier.
  113. Keyword argument _attributes: AppleEvent attribute dictionary
  114. """
  115. _code = 'aevt'
  116. _subcode = 'pdoc'
  117. if _arguments: raise TypeError, 'No optional args expected'
  118. _arguments['----'] = _object
  119. _reply, _arguments, _attributes = self.send(_code, _subcode,
  120. _arguments, _attributes)
  121. if _arguments.get('errn', 0):
  122. raise aetools.Error, aetools.decodeerror(_arguments)
  123. # XXXX Optionally decode result
  124. if _arguments.has_key('----'):
  125. return _arguments['----']
  126. _argmap_save = {
  127. 'in_' : 'kfil',
  128. 'as' : 'fltp',
  129. }
  130. def save(self, _object, _attributes={}, **_arguments):
  131. """save: save a set of objects
  132. Required argument: Objects to save.
  133. Keyword argument in_: the file in which to save the object(s)
  134. Keyword argument as: the file type of the document in which to save the data
  135. Keyword argument _attributes: AppleEvent attribute dictionary
  136. """
  137. _code = 'core'
  138. _subcode = 'save'
  139. aetools.keysubst(_arguments, self._argmap_save)
  140. _arguments['----'] = _object
  141. _reply, _arguments, _attributes = self.send(_code, _subcode,
  142. _arguments, _attributes)
  143. if _arguments.get('errn', 0):
  144. raise aetools.Error, aetools.decodeerror(_arguments)
  145. # XXXX Optionally decode result
  146. if _arguments.has_key('----'):
  147. return _arguments['----']
  148. _argmap_set = {
  149. 'to' : 'data',
  150. }
  151. def set(self, _object, _attributes={}, **_arguments):
  152. """set: Set an object\xd5s data
  153. Required argument: the object to change
  154. Keyword argument to: the new value
  155. Keyword argument _attributes: AppleEvent attribute dictionary
  156. """
  157. _code = 'core'
  158. _subcode = 'setd'
  159. aetools.keysubst(_arguments, self._argmap_set)
  160. _arguments['----'] = _object
  161. _reply, _arguments, _attributes = self.send(_code, _subcode,
  162. _arguments, _attributes)
  163. if _arguments.get('errn', 0):
  164. raise aetools.Error, aetools.decodeerror(_arguments)
  165. # XXXX Optionally decode result
  166. if _arguments.has_key('----'):
  167. return _arguments['----']
  168. class application(aetools.ComponentItem):
  169. """application - An application program """
  170. want = 'capp'
  171. # element 'cwin' as ['indx', 'name', 'rele']
  172. # element 'docu' as ['name']
  173. class window(aetools.ComponentItem):
  174. """window - A Window """
  175. want = 'cwin'
  176. class _Prop_bounds(aetools.NProperty):
  177. """bounds - the boundary rectangle for the window """
  178. which = 'pbnd'
  179. want = 'qdrt'
  180. class _Prop_closeable(aetools.NProperty):
  181. """closeable - Does the window have a close box? """
  182. which = 'hclb'
  183. want = 'bool'
  184. class _Prop_floating(aetools.NProperty):
  185. """floating - Does the window float? """
  186. which = 'isfl'
  187. want = 'bool'
  188. class _Prop_index(aetools.NProperty):
  189. """index - the number of the window """
  190. which = 'pidx'
  191. want = 'long'
  192. class _Prop_modal(aetools.NProperty):
  193. """modal - Is the window modal? """
  194. which = 'pmod'
  195. want = 'bool'
  196. class _Prop_name(aetools.NProperty):
  197. """name - the title of the window """
  198. which = 'pnam'
  199. want = 'itxt'
  200. class _Prop_position(aetools.NProperty):
  201. """position - upper left coordinates of window """
  202. which = 'ppos'
  203. want = 'QDpt'
  204. class _Prop_resizable(aetools.NProperty):
  205. """resizable - Is the window resizable? """
  206. which = 'prsz'
  207. want = 'bool'
  208. class _Prop_titled(aetools.NProperty):
  209. """titled - Does the window have a title bar? """
  210. which = 'ptit'
  211. want = 'bool'
  212. class _Prop_visible(aetools.NProperty):
  213. """visible - is the window visible? """
  214. which = 'pvis'
  215. want = 'bool'
  216. class _Prop_zoomable(aetools.NProperty):
  217. """zoomable - Is the window zoomable? """
  218. which = 'iszm'
  219. want = 'bool'
  220. class _Prop_zoomed(aetools.NProperty):
  221. """zoomed - Is the window zoomed? """
  222. which = 'pzum'
  223. want = 'bool'
  224. class document(aetools.ComponentItem):
  225. """document - A Document """
  226. want = 'docu'
  227. class _Prop_modified(aetools.NProperty):
  228. """modified - Has the document been modified since the last save? """
  229. which = 'imod'
  230. want = 'bool'
  231. application._superclassnames = []
  232. application._privpropdict = {
  233. }
  234. application._privelemdict = {
  235. 'document' : document,
  236. 'window' : window,
  237. }
  238. window._superclassnames = []
  239. window._privpropdict = {
  240. 'bounds' : _Prop_bounds,
  241. 'closeable' : _Prop_closeable,
  242. 'floating' : _Prop_floating,
  243. 'index' : _Prop_index,
  244. 'modal' : _Prop_modal,
  245. 'name' : _Prop_name,
  246. 'position' : _Prop_position,
  247. 'resizable' : _Prop_resizable,
  248. 'titled' : _Prop_titled,
  249. 'visible' : _Prop_visible,
  250. 'zoomable' : _Prop_zoomable,
  251. 'zoomed' : _Prop_zoomed,
  252. }
  253. window._privelemdict = {
  254. }
  255. document._superclassnames = []
  256. document._privpropdict = {
  257. 'modified' : _Prop_modified,
  258. 'name' : _Prop_name,
  259. }
  260. document._privelemdict = {
  261. }
  262. _Enum_savo = {
  263. 'yes' : 'yes ', # Save objects now
  264. 'no' : 'no ', # Do not save objects
  265. 'ask' : 'ask ', # Ask the user whether to save
  266. }
  267. #
  268. # Indices of types declared in this module
  269. #
  270. _classdeclarations = {
  271. 'capp' : application,
  272. 'cwin' : window,
  273. 'docu' : document,
  274. }
  275. _propdeclarations = {
  276. 'hclb' : _Prop_closeable,
  277. 'imod' : _Prop_modified,
  278. 'isfl' : _Prop_floating,
  279. 'iszm' : _Prop_zoomable,
  280. 'pbnd' : _Prop_bounds,
  281. 'pidx' : _Prop_index,
  282. 'pmod' : _Prop_modal,
  283. 'pnam' : _Prop_name,
  284. 'ppos' : _Prop_position,
  285. 'prsz' : _Prop_resizable,
  286. 'ptit' : _Prop_titled,
  287. 'pvis' : _Prop_visible,
  288. 'pzum' : _Prop_zoomed,
  289. }
  290. _compdeclarations = {
  291. }
  292. _enumdeclarations = {
  293. 'savo' : _Enum_savo,
  294. }