home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / MacHacksBug / Python 1.5.2c1 / Mac / Lib / lib-scripting / Required_Suite.py < prev    next >
Encoding:
Python Source  |  2000-06-23  |  2.9 KB  |  108 lines

  1. """Suite Required Suite: Terms that every application should support
  2. Level 1, version 1
  3.  
  4. Generated from flap:System Folder:Extensions:Scripting Additions:Dialects:English Dialect
  5. AETE/AEUT resource version 1/0, language 0, script 0
  6. """
  7.  
  8. import aetools
  9. import MacOS
  10.  
  11. _code = 'reqd'
  12.  
  13. class Required_Suite:
  14.  
  15.     def open(self, _object, _attributes={}, **_arguments):
  16.         """open: Open the specified object(s)
  17.         Required argument: list of objects to open
  18.         Keyword argument _attributes: AppleEvent attribute dictionary
  19.         """
  20.         _code = 'aevt'
  21.         _subcode = 'odoc'
  22.  
  23.         if _arguments: raise TypeError, 'No optional args expected'
  24.         _arguments['----'] = _object
  25.  
  26.  
  27.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  28.                 _arguments, _attributes)
  29.         if _arguments.has_key('errn'):
  30.             raise aetools.Error, aetools.decodeerror(_arguments)
  31.         # XXXX Optionally decode result
  32.         if _arguments.has_key('----'):
  33.             return _arguments['----']
  34.  
  35.     def _print(self, _object, _attributes={}, **_arguments):
  36.         """print: Print the specified object(s)
  37.         Required argument: list of objects to print
  38.         Keyword argument _attributes: AppleEvent attribute dictionary
  39.         """
  40.         _code = 'aevt'
  41.         _subcode = 'pdoc'
  42.  
  43.         if _arguments: raise TypeError, 'No optional args expected'
  44.         _arguments['----'] = _object
  45.  
  46.  
  47.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  48.                 _arguments, _attributes)
  49.         if _arguments.has_key('errn'):
  50.             raise aetools.Error, aetools.decodeerror(_arguments)
  51.         # XXXX Optionally decode result
  52.         if _arguments.has_key('----'):
  53.             return _arguments['----']
  54.  
  55.     def quit(self, _no_object=None, _attributes={}, **_arguments):
  56.         """quit: Quit application
  57.         Keyword argument _attributes: AppleEvent attribute dictionary
  58.         """
  59.         _code = 'aevt'
  60.         _subcode = 'quit'
  61.  
  62.         if _arguments: raise TypeError, 'No optional args expected'
  63.         if _no_object != None: raise TypeError, 'No direct arg expected'
  64.  
  65.  
  66.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  67.                 _arguments, _attributes)
  68.         if _arguments.has_key('errn'):
  69.             raise aetools.Error, aetools.decodeerror(_arguments)
  70.         # XXXX Optionally decode result
  71.         if _arguments.has_key('----'):
  72.             return _arguments['----']
  73.  
  74.     def run(self, _no_object=None, _attributes={}, **_arguments):
  75.         """run: Sent to an application when it is double-clicked
  76.         Keyword argument _attributes: AppleEvent attribute dictionary
  77.         """
  78.         _code = 'aevt'
  79.         _subcode = 'oapp'
  80.  
  81.         if _arguments: raise TypeError, 'No optional args expected'
  82.         if _no_object != None: raise TypeError, 'No direct arg expected'
  83.  
  84.  
  85.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  86.                 _arguments, _attributes)
  87.         if _arguments.has_key('errn'):
  88.             raise aetools.Error, aetools.decodeerror(_arguments)
  89.         # XXXX Optionally decode result
  90.         if _arguments.has_key('----'):
  91.             return _arguments['----']
  92.  
  93.  
  94. #
  95. # Indices of types declared in this module
  96. #
  97. _classdeclarations = {
  98. }
  99.  
  100. _propdeclarations = {
  101. }
  102.  
  103. _compdeclarations = {
  104. }
  105.  
  106. _enumdeclarations = {
  107. }
  108.