PageRenderTime 50ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/lib-python/2.7/plat-mac/lib-scriptpackages/Explorer/Web_Browser_Suite.py

https://bitbucket.org/dac_io/pypy
Python | 226 lines | 173 code | 21 blank | 32 comment | 13 complexity | 47eb71367c5778b13d47d3ebe7fbdae7 MD5 | raw file
  1. """Suite Web Browser Suite: Class of events supported by Web Browser applications
  2. Level 1, version 1
  3. Generated from /Applications/Internet Explorer.app
  4. AETE/AEUT resource version 1/0, language 0, script 0
  5. """
  6. import aetools
  7. import MacOS
  8. _code = 'WWW!'
  9. class Web_Browser_Suite_Events:
  10. def Activate(self, _object=None, _attributes={}, **_arguments):
  11. """Activate: Activate Internet Explorer and optionally select window designated by Window Identifier.
  12. Required argument: Window Identifier
  13. Keyword argument _attributes: AppleEvent attribute dictionary
  14. Returns: Window Identifier of window to activate
  15. """
  16. _code = 'WWW!'
  17. _subcode = 'ACTV'
  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. def CloseAllWindows(self, _no_object=None, _attributes={}, **_arguments):
  28. """CloseAllWindows: Closes all windows
  29. Keyword argument _attributes: AppleEvent attribute dictionary
  30. Returns: Success
  31. """
  32. _code = 'WWW!'
  33. _subcode = 'CLSA'
  34. if _arguments: raise TypeError, 'No optional args expected'
  35. if _no_object is not None: raise TypeError, 'No direct arg expected'
  36. _reply, _arguments, _attributes = self.send(_code, _subcode,
  37. _arguments, _attributes)
  38. if _arguments.get('errn', 0):
  39. raise aetools.Error, aetools.decodeerror(_arguments)
  40. # XXXX Optionally decode result
  41. if _arguments.has_key('----'):
  42. return _arguments['----']
  43. _argmap_CloseWindow = {
  44. 'ID' : 'WIND',
  45. 'Title' : 'TITL',
  46. }
  47. def CloseWindow(self, _no_object=None, _attributes={}, **_arguments):
  48. """CloseWindow: Close the window specified by either Window Identifier or Title. If no parameter is specified, close the top window.
  49. Keyword argument ID: ID of the window to close. (Can use -1 for top window)
  50. Keyword argument Title: Title of the window to close
  51. Keyword argument _attributes: AppleEvent attribute dictionary
  52. Returns: Success
  53. """
  54. _code = 'WWW!'
  55. _subcode = 'CLOS'
  56. aetools.keysubst(_arguments, self._argmap_CloseWindow)
  57. if _no_object is not None: raise TypeError, 'No direct arg expected'
  58. _reply, _arguments, _attributes = self.send(_code, _subcode,
  59. _arguments, _attributes)
  60. if _arguments.get('errn', 0):
  61. raise aetools.Error, aetools.decodeerror(_arguments)
  62. # XXXX Optionally decode result
  63. if _arguments.has_key('----'):
  64. return _arguments['----']
  65. def GetWindowInfo(self, _object, _attributes={}, **_arguments):
  66. """GetWindowInfo: Returns a window info record (URL/Title) for the specified window.
  67. Required argument: Window Identifier of the window
  68. Keyword argument _attributes: AppleEvent attribute dictionary
  69. Returns:
  70. """
  71. _code = 'WWW!'
  72. _subcode = 'WNFO'
  73. if _arguments: raise TypeError, 'No optional args expected'
  74. _arguments['----'] = _object
  75. _reply, _arguments, _attributes = self.send(_code, _subcode,
  76. _arguments, _attributes)
  77. if _arguments.get('errn', 0):
  78. raise aetools.Error, aetools.decodeerror(_arguments)
  79. # XXXX Optionally decode result
  80. if _arguments.has_key('----'):
  81. return _arguments['----']
  82. def ListWindows(self, _no_object=None, _attributes={}, **_arguments):
  83. """ListWindows: Returns list of Window Identifiers for all open windows.
  84. Keyword argument _attributes: AppleEvent attribute dictionary
  85. Returns: undocumented, typecode 'list'
  86. """
  87. _code = 'WWW!'
  88. _subcode = 'LSTW'
  89. if _arguments: raise TypeError, 'No optional args expected'
  90. if _no_object is not None: raise TypeError, 'No direct arg expected'
  91. _reply, _arguments, _attributes = self.send(_code, _subcode,
  92. _arguments, _attributes)
  93. if _arguments.get('errn', 0):
  94. raise aetools.Error, aetools.decodeerror(_arguments)
  95. # XXXX Optionally decode result
  96. if _arguments.has_key('----'):
  97. return _arguments['----']
  98. _argmap_OpenURL = {
  99. 'to' : 'INTO',
  100. 'toWindow' : 'WIND',
  101. 'Flags' : 'FLGS',
  102. 'FormData' : 'POST',
  103. 'MIME_Type' : 'MIME',
  104. }
  105. def OpenURL(self, _object, _attributes={}, **_arguments):
  106. """OpenURL: Retrieves URL off the Web.
  107. Required argument: Fully-qualified URL
  108. Keyword argument to: Target file for saving downloaded data
  109. Keyword argument toWindow: Target window for resource at URL (-1 for top window, 0 for new window)
  110. Keyword argument Flags: Valid Flags settings are: 1-Ignore the document cache; 2-Ignore the image cache; 4-Operate in background mode.
  111. Keyword argument FormData: data to post
  112. Keyword argument MIME_Type: MIME type of data being posted
  113. Keyword argument _attributes: AppleEvent attribute dictionary
  114. """
  115. _code = 'WWW!'
  116. _subcode = 'OURL'
  117. aetools.keysubst(_arguments, self._argmap_OpenURL)
  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_ParseAnchor = {
  127. 'withURL' : 'RELA',
  128. }
  129. def ParseAnchor(self, _object, _attributes={}, **_arguments):
  130. """ParseAnchor: Combines a base URL and a relative URL to produce a fully-qualified URL
  131. Required argument: Base URL
  132. Keyword argument withURL: Relative URL that is combined with the Base URL (in the direct object) to produce a fully-qualified URL.
  133. Keyword argument _attributes: AppleEvent attribute dictionary
  134. Returns: Fully-qualified URL
  135. """
  136. _code = 'WWW!'
  137. _subcode = 'PRSA'
  138. aetools.keysubst(_arguments, self._argmap_ParseAnchor)
  139. _arguments['----'] = _object
  140. _reply, _arguments, _attributes = self.send(_code, _subcode,
  141. _arguments, _attributes)
  142. if _arguments.get('errn', 0):
  143. raise aetools.Error, aetools.decodeerror(_arguments)
  144. # XXXX Optionally decode result
  145. if _arguments.has_key('----'):
  146. return _arguments['----']
  147. _argmap_ShowFile = {
  148. 'MIME_Type' : 'MIME',
  149. 'Window_Identifier' : 'WIND',
  150. 'URL' : 'URL ',
  151. }
  152. def ShowFile(self, _object, _attributes={}, **_arguments):
  153. """ShowFile: FileSpec containing data of specified MIME type to be rendered in window specified by Window Identifier.
  154. Required argument: The file
  155. Keyword argument MIME_Type: MIME type
  156. Keyword argument Window_Identifier: Identifier of the target window for the URL. (Can use -1 for top window)
  157. Keyword argument URL: URL that allows this document to be reloaded.
  158. Keyword argument _attributes: AppleEvent attribute dictionary
  159. """
  160. _code = 'WWW!'
  161. _subcode = 'SHWF'
  162. aetools.keysubst(_arguments, self._argmap_ShowFile)
  163. _arguments['----'] = _object
  164. _reply, _arguments, _attributes = self.send(_code, _subcode,
  165. _arguments, _attributes)
  166. if _arguments.get('errn', 0):
  167. raise aetools.Error, aetools.decodeerror(_arguments)
  168. # XXXX Optionally decode result
  169. if _arguments.has_key('----'):
  170. return _arguments['----']
  171. #
  172. # Indices of types declared in this module
  173. #
  174. _classdeclarations = {
  175. }
  176. _propdeclarations = {
  177. }
  178. _compdeclarations = {
  179. }
  180. _enumdeclarations = {
  181. }