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

  1. """Suite 7.0 Finder Suite: This is the original Finder suite. These events will be supported in the future, but the syntax may be changed in a future Finder release.
  2. Level 1, version 1
  3.  
  4. Generated from flap:System Folder:Finder
  5. AETE/AEUT resource version 0/149, language 0, script 0
  6. """
  7. # XXXX Hand edited to change the classname
  8.  
  9. import aetools
  10. import MacOS
  11.  
  12. _code = 'FNDR'
  13.  
  14. class Finder_7_0_Suite:
  15.  
  16.     def open_about_box(self, _no_object=None, _attributes={}, **_arguments):
  17.         """open about box: Open the 'About This Mac' window
  18.         Keyword argument _attributes: AppleEvent attribute dictionary
  19.         """
  20.         _code = 'aevt'
  21.         _subcode = 'abou'
  22.  
  23.         if _arguments: raise TypeError, 'No optional args expected'
  24.         if _no_object != None: raise TypeError, 'No direct arg expected'
  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.     _argmap_copy_to = {
  36.         '_from' : 'fsel',
  37.     }
  38.  
  39.     def copy_to(self, _object, _attributes={}, **_arguments):
  40.         """copy to: Copies one or more items into a folder
  41.         Required argument: Alias for folder into which the items are copied
  42.         Keyword argument _from: List of aliases for items to be copied
  43.         Keyword argument _attributes: AppleEvent attribute dictionary
  44.         """
  45.         _code = 'FNDR'
  46.         _subcode = 'drag'
  47.  
  48.         aetools.keysubst(_arguments, self._argmap_copy_to)
  49.         _arguments['----'] = _object
  50.  
  51.  
  52.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  53.                 _arguments, _attributes)
  54.         if _arguments.has_key('errn'):
  55.             raise aetools.Error, aetools.decodeerror(_arguments)
  56.         # XXXX Optionally decode result
  57.         if _arguments.has_key('----'):
  58.             return _arguments['----']
  59.  
  60.     _argmap_duplicate = {
  61.         'items' : 'fsel',
  62.     }
  63.  
  64.     def duplicate(self, _object, _attributes={}, **_arguments):
  65.         """duplicate: Duplicate a set of items in a folder
  66.         Required argument: Alias for folder containing the items
  67.         Keyword argument items: List of aliases for items in the folder
  68.         Keyword argument _attributes: AppleEvent attribute dictionary
  69.         """
  70.         _code = 'FNDR'
  71.         _subcode = 'sdup'
  72.  
  73.         aetools.keysubst(_arguments, self._argmap_duplicate)
  74.         _arguments['----'] = _object
  75.  
  76.  
  77.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  78.                 _arguments, _attributes)
  79.         if _arguments.has_key('errn'):
  80.             raise aetools.Error, aetools.decodeerror(_arguments)
  81.         # XXXX Optionally decode result
  82.         if _arguments.has_key('----'):
  83.             return _arguments['----']
  84.  
  85.     def empty_trash(self, _no_object=None, _attributes={}, **_arguments):
  86.         """empty trash: Empties the trash
  87.         Keyword argument _attributes: AppleEvent attribute dictionary
  88.         """
  89.         _code = 'FNDR'
  90.         _subcode = 'empt'
  91.  
  92.         if _arguments: raise TypeError, 'No optional args expected'
  93.         if _no_object != None: raise TypeError, 'No direct arg expected'
  94.  
  95.  
  96.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  97.                 _arguments, _attributes)
  98.         if _arguments.has_key('errn'):
  99.             raise aetools.Error, aetools.decodeerror(_arguments)
  100.         # XXXX Optionally decode result
  101.         if _arguments.has_key('----'):
  102.             return _arguments['----']
  103.  
  104.     _argmap_make_aliases_for = {
  105.         'items' : 'fsel',
  106.     }
  107.  
  108.     def make_aliases_for(self, _object, _attributes={}, **_arguments):
  109.         """make aliases for: Make aliases to items from a single folder
  110.         Required argument: Alias for folder containing the items
  111.         Keyword argument items: List of aliases for items in folder
  112.         Keyword argument _attributes: AppleEvent attribute dictionary
  113.         """
  114.         _code = 'FNDR'
  115.         _subcode = 'sali'
  116.  
  117.         aetools.keysubst(_arguments, self._argmap_make_aliases_for)
  118.         _arguments['----'] = _object
  119.  
  120.  
  121.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  122.                 _arguments, _attributes)
  123.         if _arguments.has_key('errn'):
  124.             raise aetools.Error, aetools.decodeerror(_arguments)
  125.         # XXXX Optionally decode result
  126.         if _arguments.has_key('----'):
  127.             return _arguments['----']
  128.  
  129.     _argmap_move_to = {
  130.         '_from' : 'fsel',
  131.     }
  132.  
  133.     def move_to(self, _object, _attributes={}, **_arguments):
  134.         """move to: Move one or more items into a folder
  135.         Required argument: Alias for destination folder
  136.         Keyword argument _from: List of aliases for items to be moved 
  137.         Keyword argument _attributes: AppleEvent attribute dictionary
  138.         """
  139.         _code = 'FNDR'
  140.         _subcode = 'move'
  141.  
  142.         aetools.keysubst(_arguments, self._argmap_move_to)
  143.         _arguments['----'] = _object
  144.  
  145.  
  146.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  147.                 _arguments, _attributes)
  148.         if _arguments.has_key('errn'):
  149.             raise aetools.Error, aetools.decodeerror(_arguments)
  150.         # XXXX Optionally decode result
  151.         if _arguments.has_key('----'):
  152.             return _arguments['----']
  153.  
  154.     def sleep(self, _no_object=None, _attributes={}, **_arguments):
  155.         """sleep: Put portable into sleep mode
  156.         Keyword argument _attributes: AppleEvent attribute dictionary
  157.         """
  158.         _code = 'FNDR'
  159.         _subcode = 'slep'
  160.  
  161.         if _arguments: raise TypeError, 'No optional args expected'
  162.         if _no_object != None: raise TypeError, 'No direct arg expected'
  163.  
  164.  
  165.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  166.                 _arguments, _attributes)
  167.         if _arguments.has_key('errn'):
  168.             raise aetools.Error, aetools.decodeerror(_arguments)
  169.         # XXXX Optionally decode result
  170.         if _arguments.has_key('----'):
  171.             return _arguments['----']
  172.  
  173.     def shut_down(self, _no_object=None, _attributes={}, **_arguments):
  174.         """shut down: Shuts down the Macintosh if all applications can quit
  175.         Keyword argument _attributes: AppleEvent attribute dictionary
  176.         """
  177.         _code = 'FNDR'
  178.         _subcode = 'shut'
  179.  
  180.         if _arguments: raise TypeError, 'No optional args expected'
  181.         if _no_object != None: raise TypeError, 'No direct arg expected'
  182.  
  183.  
  184.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  185.                 _arguments, _attributes)
  186.         if _arguments.has_key('errn'):
  187.             raise aetools.Error, aetools.decodeerror(_arguments)
  188.         # XXXX Optionally decode result
  189.         if _arguments.has_key('----'):
  190.             return _arguments['----']
  191.  
  192.     _argmap_open = {
  193.         'items' : 'fsel',
  194.     }
  195.  
  196.     def open(self, _object, _attributes={}, **_arguments):
  197.         """open: Open folders, files, or applications from a given folder
  198.         Required argument: Alias for folder containing the items
  199.         Keyword argument items: List of aliases for items in the folder
  200.         Keyword argument _attributes: AppleEvent attribute dictionary
  201.         """
  202.         _code = 'FNDR'
  203.         _subcode = 'sope'
  204.  
  205.         aetools.keysubst(_arguments, self._argmap_open)
  206.         _arguments['----'] = _object
  207.  
  208.  
  209.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  210.                 _arguments, _attributes)
  211.         if _arguments.has_key('errn'):
  212.             raise aetools.Error, aetools.decodeerror(_arguments)
  213.         # XXXX Optionally decode result
  214.         if _arguments.has_key('----'):
  215.             return _arguments['----']
  216.  
  217.     _argmap__print = {
  218.         'items' : 'fsel',
  219.     }
  220.  
  221.     def _print(self, _object, _attributes={}, **_arguments):
  222.         """print: Print items from a given folder
  223.         Required argument: Alias for folder containing the items
  224.         Keyword argument items: List of aliases for items in folder
  225.         Keyword argument _attributes: AppleEvent attribute dictionary
  226.         """
  227.         _code = 'FNDR'
  228.         _subcode = 'spri'
  229.  
  230.         aetools.keysubst(_arguments, self._argmap__print)
  231.         _arguments['----'] = _object
  232.  
  233.  
  234.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  235.                 _arguments, _attributes)
  236.         if _arguments.has_key('errn'):
  237.             raise aetools.Error, aetools.decodeerror(_arguments)
  238.         # XXXX Optionally decode result
  239.         if _arguments.has_key('----'):
  240.             return _arguments['----']
  241.  
  242.     _argmap_put_away = {
  243.         'items' : 'fsel',
  244.     }
  245.  
  246.     def put_away(self, _object, _attributes={}, **_arguments):
  247.         """put away: Put away items from a given folder
  248.         Required argument: Alias for folder containing the items
  249.         Keyword argument items: List of aliases to items in folder
  250.         Keyword argument _attributes: AppleEvent attribute dictionary
  251.         Returns: undocumented, typecode 'alis'
  252.         """
  253.         _code = 'FNDR'
  254.         _subcode = 'sput'
  255.  
  256.         aetools.keysubst(_arguments, self._argmap_put_away)
  257.         _arguments['----'] = _object
  258.  
  259.  
  260.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  261.                 _arguments, _attributes)
  262.         if _arguments.has_key('errn'):
  263.             raise aetools.Error, aetools.decodeerror(_arguments)
  264.         # XXXX Optionally decode result
  265.         if _arguments.has_key('----'):
  266.             return _arguments['----']
  267.  
  268.     def restart(self, _no_object=None, _attributes={}, **_arguments):
  269.         """restart: Restart the Macintosh
  270.         Keyword argument _attributes: AppleEvent attribute dictionary
  271.         """
  272.         _code = 'FNDR'
  273.         _subcode = 'rest'
  274.  
  275.         if _arguments: raise TypeError, 'No optional args expected'
  276.         if _no_object != None: raise TypeError, 'No direct arg expected'
  277.  
  278.  
  279.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  280.                 _arguments, _attributes)
  281.         if _arguments.has_key('errn'):
  282.             raise aetools.Error, aetools.decodeerror(_arguments)
  283.         # XXXX Optionally decode result
  284.         if _arguments.has_key('----'):
  285.             return _arguments['----']
  286.  
  287.     _argmap_select = {
  288.         'items' : 'fsel',
  289.     }
  290.  
  291.     def select(self, _object, _attributes={}, **_arguments):
  292.         """select: Select items in a folder
  293.         Required argument: Alias for folder containing the items
  294.         Keyword argument items: List of aliases for items in folder
  295.         Keyword argument _attributes: AppleEvent attribute dictionary
  296.         """
  297.         _code = 'FNDR'
  298.         _subcode = 'srev'
  299.  
  300.         aetools.keysubst(_arguments, self._argmap_select)
  301.         _arguments['----'] = _object
  302.  
  303.  
  304.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  305.                 _arguments, _attributes)
  306.         if _arguments.has_key('errn'):
  307.             raise aetools.Error, aetools.decodeerror(_arguments)
  308.         # XXXX Optionally decode result
  309.         if _arguments.has_key('----'):
  310.             return _arguments['----']
  311.  
  312.  
  313. #
  314. # Indices of types declared in this module
  315. #
  316. _classdeclarations = {
  317. }
  318.  
  319. _propdeclarations = {
  320. }
  321.  
  322. _compdeclarations = {
  323. }
  324.  
  325. _enumdeclarations = {
  326. }
  327.