home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 May / maximum-cd-2010-05.iso / DiscContents / boxee-0.9.20.10711.exe / system / python / Lib / plat-mac / lib-scriptpackages / Netscape / WorldWideWeb_suite.pyo (.txt) < prev   
Encoding:
Python Compiled Bytecode  |  2009-07-20  |  13.8 KB  |  379 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.4)
  3.  
  4. '''Suite WorldWideWeb suite, as defined in Spyglass spec.:
  5. Level 1, version 1
  6.  
  7. Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2
  8. AETE/AEUT resource version 1/0, language 0, script 0
  9. '''
  10. import aetools
  11. import MacOS
  12. _code = 'WWW!'
  13.  
  14. class WorldWideWeb_suite_Events:
  15.     _argmap_OpenURL = {
  16.         'to': 'INTO',
  17.         'toWindow': 'WIND',
  18.         'flags': 'FLGS',
  19.         'post_data': 'POST',
  20.         'post_type': 'MIME',
  21.         'progressApp': 'PROG' }
  22.     
  23.     def OpenURL(self, _object, _attributes = { }, **_arguments):
  24.         '''OpenURL: Opens a URL. Allows for more options than GetURL event
  25.         Required argument: URL
  26.         Keyword argument to: file destination
  27.         Keyword argument toWindow: window iD
  28.         Keyword argument flags: Binary: any combination of 1, 2 and 4 is allowed: 1 and 2 mean force reload the document. 4 is ignored
  29.         Keyword argument post_data: Form posting data
  30.         Keyword argument post_type: MIME type of the posting data. Defaults to application/x-www-form-urlencoded
  31.         Keyword argument progressApp: Application that will display progress
  32.         Keyword argument _attributes: AppleEvent attribute dictionary
  33.         Returns: ID of the loading window
  34.         '''
  35.         _code = 'WWW!'
  36.         _subcode = 'OURL'
  37.         aetools.keysubst(_arguments, self._argmap_OpenURL)
  38.         _arguments['----'] = _object
  39.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  40.         if _arguments.get('errn', 0):
  41.             raise aetools.Error, aetools.decodeerror(_arguments)
  42.         
  43.         if _arguments.has_key('----'):
  44.             return _arguments['----']
  45.         
  46.  
  47.     _argmap_ShowFile = {
  48.         'MIME_type': 'MIME',
  49.         'Window_ID': 'WIND',
  50.         'URL': 'URL ' }
  51.     
  52.     def ShowFile(self, _object, _attributes = { }, **_arguments):
  53.         '''ShowFile: Similar to OpenDocuments, except that it specifies the parent URL, and MIME type of the file
  54.         Required argument: File to open
  55.         Keyword argument MIME_type: MIME type
  56.         Keyword argument Window_ID: Window to open the file in
  57.         Keyword argument URL: Use this as a base URL
  58.         Keyword argument _attributes: AppleEvent attribute dictionary
  59.         Returns: Window ID of the loaded window. 0 means ShowFile failed, FFFFFFF means that data was not appropriate type to display in the browser.
  60.         '''
  61.         _code = 'WWW!'
  62.         _subcode = 'SHWF'
  63.         aetools.keysubst(_arguments, self._argmap_ShowFile)
  64.         _arguments['----'] = _object
  65.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  66.         if _arguments.get('errn', 0):
  67.             raise aetools.Error, aetools.decodeerror(_arguments)
  68.         
  69.         if _arguments.has_key('----'):
  70.             return _arguments['----']
  71.         
  72.  
  73.     _argmap_cancel_progress = {
  74.         'in_window': 'WIND' }
  75.     
  76.     def cancel_progress(self, _object = None, _attributes = { }, **_arguments):
  77.         '''cancel progress: Interrupts the download of the document in the given window
  78.         Required argument: progress ID, obtained from the progress app
  79.         Keyword argument in_window: window ID of the progress to cancel
  80.         Keyword argument _attributes: AppleEvent attribute dictionary
  81.         '''
  82.         _code = 'WWW!'
  83.         _subcode = 'CNCL'
  84.         aetools.keysubst(_arguments, self._argmap_cancel_progress)
  85.         _arguments['----'] = _object
  86.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  87.         if _arguments.get('errn', 0):
  88.             raise aetools.Error, aetools.decodeerror(_arguments)
  89.         
  90.         if _arguments.has_key('----'):
  91.             return _arguments['----']
  92.         
  93.  
  94.     
  95.     def find_URL(self, _object, _attributes = { }, **_arguments):
  96.         '''find URL: If the file was downloaded by Netscape, you can call FindURL to find out the URL used to download the file.
  97.         Required argument: File spec
  98.         Keyword argument _attributes: AppleEvent attribute dictionary
  99.         Returns: The URL
  100.         '''
  101.         _code = 'WWW!'
  102.         _subcode = 'FURL'
  103.         if _arguments:
  104.             raise TypeError, 'No optional args expected'
  105.         
  106.         _arguments['----'] = _object
  107.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  108.         if _arguments.get('errn', 0):
  109.             raise aetools.Error, aetools.decodeerror(_arguments)
  110.         
  111.         if _arguments.has_key('----'):
  112.             return _arguments['----']
  113.         
  114.  
  115.     
  116.     def get_window_info(self, _object = None, _attributes = { }, **_arguments):
  117.         """get window info: Returns the information about the window as a list. Currently the list contains the window title and the URL. You can get the same information using standard Apple Event GetProperty.
  118.         Required argument: window ID
  119.         Keyword argument _attributes: AppleEvent attribute dictionary
  120.         Returns: undocumented, typecode 'list'
  121.         """
  122.         _code = 'WWW!'
  123.         _subcode = 'WNFO'
  124.         if _arguments:
  125.             raise TypeError, 'No optional args expected'
  126.         
  127.         _arguments['----'] = _object
  128.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  129.         if _arguments.get('errn', 0):
  130.             raise aetools.Error, aetools.decodeerror(_arguments)
  131.         
  132.         if _arguments.has_key('----'):
  133.             return _arguments['----']
  134.         
  135.  
  136.     
  137.     def list_windows(self, _no_object = None, _attributes = { }, **_arguments):
  138.         '''list windows: Lists the IDs of all the hypertext windows
  139.         Keyword argument _attributes: AppleEvent attribute dictionary
  140.         Returns: List of unique IDs of all the hypertext windows
  141.         '''
  142.         _code = 'WWW!'
  143.         _subcode = 'LSTW'
  144.         if _arguments:
  145.             raise TypeError, 'No optional args expected'
  146.         
  147.         if _no_object != None:
  148.             raise TypeError, 'No direct arg expected'
  149.         
  150.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  151.         if _arguments.get('errn', 0):
  152.             raise aetools.Error, aetools.decodeerror(_arguments)
  153.         
  154.         if _arguments.has_key('----'):
  155.             return _arguments['----']
  156.         
  157.  
  158.     _argmap_parse_anchor = {
  159.         'relative_to': 'RELA' }
  160.     
  161.     def parse_anchor(self, _object, _attributes = { }, **_arguments):
  162.         '''parse anchor: Resolves the relative URL
  163.         Required argument: Main URL
  164.         Keyword argument relative_to: Relative URL
  165.         Keyword argument _attributes: AppleEvent attribute dictionary
  166.         Returns: Parsed  URL
  167.         '''
  168.         _code = 'WWW!'
  169.         _subcode = 'PRSA'
  170.         aetools.keysubst(_arguments, self._argmap_parse_anchor)
  171.         _arguments['----'] = _object
  172.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  173.         if _arguments.get('errn', 0):
  174.             raise aetools.Error, aetools.decodeerror(_arguments)
  175.         
  176.         if _arguments.has_key('----'):
  177.             return _arguments['----']
  178.         
  179.  
  180.     
  181.     def register_URL_echo(self, _object = None, _attributes = { }, **_arguments):
  182.         '''register URL echo: Registers the \xd2echo\xd3 application. Each download from now on will be echoed to this application.
  183.         Required argument: Application signature
  184.         Keyword argument _attributes: AppleEvent attribute dictionary
  185.         '''
  186.         _code = 'WWW!'
  187.         _subcode = 'RGUE'
  188.         if _arguments:
  189.             raise TypeError, 'No optional args expected'
  190.         
  191.         _arguments['----'] = _object
  192.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  193.         if _arguments.get('errn', 0):
  194.             raise aetools.Error, aetools.decodeerror(_arguments)
  195.         
  196.         if _arguments.has_key('----'):
  197.             return _arguments['----']
  198.         
  199.  
  200.     _argmap_register_protocol = {
  201.         'for_protocol': 'PROT' }
  202.     
  203.     def register_protocol(self, _object = None, _attributes = { }, **_arguments):
  204.         '''register protocol: Registers application as a \xd2handler\xd3 for this protocol with a given prefix. The handler will receive \xd2OpenURL\xd3, or if that fails, \xd2GetURL\xd3 event.
  205.         Required argument: Application sig
  206.         Keyword argument for_protocol: protocol prefix: \xd2finger:\xd3, \xd2file\xd3,
  207.         Keyword argument _attributes: AppleEvent attribute dictionary
  208.         Returns: TRUE if registration has been successful
  209.         '''
  210.         _code = 'WWW!'
  211.         _subcode = 'RGPR'
  212.         aetools.keysubst(_arguments, self._argmap_register_protocol)
  213.         _arguments['----'] = _object
  214.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  215.         if _arguments.get('errn', 0):
  216.             raise aetools.Error, aetools.decodeerror(_arguments)
  217.         
  218.         if _arguments.has_key('----'):
  219.             return _arguments['----']
  220.         
  221.  
  222.     _argmap_register_viewer = {
  223.         'MIME_type': 'MIME',
  224.         'with_file_type': 'FTYP' }
  225.     
  226.     def register_viewer(self, _object, _attributes = { }, **_arguments):
  227.         '''register viewer: Registers an application as a \xd4special\xd5 viewer for this MIME type. The application will be launched with ViewDoc events
  228.         Required argument: Application sig
  229.         Keyword argument MIME_type: MIME type viewer is registering for
  230.         Keyword argument with_file_type: Mac file type for the downloaded files
  231.         Keyword argument _attributes: AppleEvent attribute dictionary
  232.         Returns: TRUE if registration has been successful
  233.         '''
  234.         _code = 'WWW!'
  235.         _subcode = 'RGVW'
  236.         aetools.keysubst(_arguments, self._argmap_register_viewer)
  237.         _arguments['----'] = _object
  238.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  239.         if _arguments.get('errn', 0):
  240.             raise aetools.Error, aetools.decodeerror(_arguments)
  241.         
  242.         if _arguments.has_key('----'):
  243.             return _arguments['----']
  244.         
  245.  
  246.     _argmap_register_window_close = {
  247.         'for_window': 'WIND' }
  248.     
  249.     def register_window_close(self, _object = None, _attributes = { }, **_arguments):
  250.         '''register window close: Netscape will notify registered application when this window closes
  251.         Required argument: Application signature
  252.         Keyword argument for_window: window ID
  253.         Keyword argument _attributes: AppleEvent attribute dictionary
  254.         Returns: true if successful
  255.         '''
  256.         _code = 'WWW!'
  257.         _subcode = 'RGWC'
  258.         aetools.keysubst(_arguments, self._argmap_register_window_close)
  259.         _arguments['----'] = _object
  260.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  261.         if _arguments.get('errn', 0):
  262.             raise aetools.Error, aetools.decodeerror(_arguments)
  263.         
  264.         if _arguments.has_key('----'):
  265.             return _arguments['----']
  266.         
  267.  
  268.     
  269.     def unregister_URL_echo(self, _object, _attributes = { }, **_arguments):
  270.         '''unregister URL echo: cancels URL echo
  271.         Required argument: application signature
  272.         Keyword argument _attributes: AppleEvent attribute dictionary
  273.         '''
  274.         _code = 'WWW!'
  275.         _subcode = 'UNRU'
  276.         if _arguments:
  277.             raise TypeError, 'No optional args expected'
  278.         
  279.         _arguments['----'] = _object
  280.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  281.         if _arguments.get('errn', 0):
  282.             raise aetools.Error, aetools.decodeerror(_arguments)
  283.         
  284.         if _arguments.has_key('----'):
  285.             return _arguments['----']
  286.         
  287.  
  288.     _argmap_unregister_protocol = {
  289.         'for_protocol': 'PROT' }
  290.     
  291.     def unregister_protocol(self, _object = None, _attributes = { }, **_arguments):
  292.         '''unregister protocol: reverses the effects of \xd2register protocol\xd3
  293.         Required argument: Application sig.
  294.         Keyword argument for_protocol: protocol prefix. If none, unregister for all protocols
  295.         Keyword argument _attributes: AppleEvent attribute dictionary
  296.         Returns: TRUE if successful
  297.         '''
  298.         _code = 'WWW!'
  299.         _subcode = 'UNRP'
  300.         aetools.keysubst(_arguments, self._argmap_unregister_protocol)
  301.         _arguments['----'] = _object
  302.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  303.         if _arguments.get('errn', 0):
  304.             raise aetools.Error, aetools.decodeerror(_arguments)
  305.         
  306.         if _arguments.has_key('----'):
  307.             return _arguments['----']
  308.         
  309.  
  310.     _argmap_unregister_viewer = {
  311.         'MIME_type': 'MIME' }
  312.     
  313.     def unregister_viewer(self, _object, _attributes = { }, **_arguments):
  314.         '''unregister viewer: Revert to the old way of handling this MIME type
  315.         Required argument: Application sig
  316.         Keyword argument MIME_type: MIME type to be unregistered
  317.         Keyword argument _attributes: AppleEvent attribute dictionary
  318.         Returns: TRUE if the event was successful
  319.         '''
  320.         _code = 'WWW!'
  321.         _subcode = 'UNRV'
  322.         aetools.keysubst(_arguments, self._argmap_unregister_viewer)
  323.         _arguments['----'] = _object
  324.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  325.         if _arguments.get('errn', 0):
  326.             raise aetools.Error, aetools.decodeerror(_arguments)
  327.         
  328.         if _arguments.has_key('----'):
  329.             return _arguments['----']
  330.         
  331.  
  332.     _argmap_unregister_window_close = {
  333.         'for_window': 'WIND' }
  334.     
  335.     def unregister_window_close(self, _object = None, _attributes = { }, **_arguments):
  336.         '''unregister window close: Undo for register window close
  337.         Required argument: Application signature
  338.         Keyword argument for_window: window ID
  339.         Keyword argument _attributes: AppleEvent attribute dictionary
  340.         Returns: true if successful
  341.         '''
  342.         _code = 'WWW!'
  343.         _subcode = 'UNRC'
  344.         aetools.keysubst(_arguments, self._argmap_unregister_window_close)
  345.         _arguments['----'] = _object
  346.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  347.         if _arguments.get('errn', 0):
  348.             raise aetools.Error, aetools.decodeerror(_arguments)
  349.         
  350.         if _arguments.has_key('----'):
  351.             return _arguments['----']
  352.         
  353.  
  354.     
  355.     def webActivate(self, _object = None, _attributes = { }, **_arguments):
  356.         '''webActivate: Makes Netscape the frontmost application, and selects a given window. This event is here for suite completeness/ cross-platform compatibility only, you should use standard AppleEvents instead.
  357.         Required argument: window to bring to front
  358.         Keyword argument _attributes: AppleEvent attribute dictionary
  359.         '''
  360.         _code = 'WWW!'
  361.         _subcode = 'ACTV'
  362.         if _arguments:
  363.             raise TypeError, 'No optional args expected'
  364.         
  365.         _arguments['----'] = _object
  366.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  367.         if _arguments.get('errn', 0):
  368.             raise aetools.Error, aetools.decodeerror(_arguments)
  369.         
  370.         if _arguments.has_key('----'):
  371.             return _arguments['----']
  372.         
  373.  
  374.  
  375. _classdeclarations = { }
  376. _propdeclarations = { }
  377. _compdeclarations = { }
  378. _enumdeclarations = { }
  379.