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 / SystemEvents / Folder_Actions_Suite.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-07-20  |  9.0 KB  |  258 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.4)
  3.  
  4. '''Suite Folder Actions Suite: Terms and Events for controlling Folder Actions
  5. Level 1, version 1
  6.  
  7. Generated from /System/Library/CoreServices/System Events.app
  8. AETE/AEUT resource version 1/0, language 0, script 0
  9. '''
  10. import aetools
  11. import MacOS
  12. _code = 'faco'
  13.  
  14. class Folder_Actions_Suite_Events:
  15.     _argmap_attach_action_to = {
  16.         'using': 'faal' }
  17.     
  18.     def attach_action_to(self, _object, _attributes = { }, **_arguments):
  19.         '''attach action to: Attach an action to a folder
  20.         Required argument: the object for the command
  21.         Keyword argument using: a file containing the script to attach
  22.         Keyword argument _attributes: AppleEvent attribute dictionary
  23.         Returns: the reply for the command
  24.         '''
  25.         _code = 'faco'
  26.         _subcode = 'atfa'
  27.         aetools.keysubst(_arguments, self._argmap_attach_action_to)
  28.         _arguments['----'] = _object
  29.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  30.         if _arguments.get('errn', 0):
  31.             raise aetools.Error, aetools.decodeerror(_arguments)
  32.         
  33.         if _arguments.has_key('----'):
  34.             return _arguments['----']
  35.         
  36.  
  37.     
  38.     def attached_scripts(self, _object, _attributes = { }, **_arguments):
  39.         '''attached scripts: List the actions attached to a folder
  40.         Required argument: the object for the command
  41.         Keyword argument _attributes: AppleEvent attribute dictionary
  42.         Returns: the reply for the command
  43.         '''
  44.         _code = 'faco'
  45.         _subcode = 'lact'
  46.         if _arguments:
  47.             raise TypeError, 'No optional args expected'
  48.         
  49.         _arguments['----'] = _object
  50.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  51.         if _arguments.get('errn', 0):
  52.             raise aetools.Error, aetools.decodeerror(_arguments)
  53.         
  54.         if _arguments.has_key('----'):
  55.             return _arguments['----']
  56.         
  57.  
  58.     _argmap_do_folder_action = {
  59.         'with_window_size': 'fnsz',
  60.         'with_item_list': 'flst',
  61.         'folder_action_code': 'actn' }
  62.     
  63.     def do_folder_action(self, _object, _attributes = { }, **_arguments):
  64.         '''do folder action: Event the Finder sends to the Folder Actions FBA
  65.         Required argument: the object for the command
  66.         Keyword argument with_window_size: the new window size for the folder action message to process
  67.         Keyword argument with_item_list: a list of items for the folder action message to process
  68.         Keyword argument folder_action_code: the folder action message to process
  69.         Keyword argument _attributes: AppleEvent attribute dictionary
  70.         Returns: the reply for the command
  71.         '''
  72.         _code = 'faco'
  73.         _subcode = 'fola'
  74.         aetools.keysubst(_arguments, self._argmap_do_folder_action)
  75.         _arguments['----'] = _object
  76.         aetools.enumsubst(_arguments, 'actn', _Enum_actn)
  77.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  78.         if _arguments.get('errn', 0):
  79.             raise aetools.Error, aetools.decodeerror(_arguments)
  80.         
  81.         if _arguments.has_key('----'):
  82.             return _arguments['----']
  83.         
  84.  
  85.     _argmap_edit_action_of = {
  86.         'using_action_name': 'snam',
  87.         'using_action_number': 'indx' }
  88.     
  89.     def edit_action_of(self, _object, _attributes = { }, **_arguments):
  90.         '''edit action of: Edit as action of a folder
  91.         Required argument: the object for the command
  92.         Keyword argument using_action_name: ...or the name of the action to edit
  93.         Keyword argument using_action_number: the index number of the action to edit...
  94.         Keyword argument _attributes: AppleEvent attribute dictionary
  95.         Returns: the reply for the command
  96.         '''
  97.         _code = 'faco'
  98.         _subcode = 'edfa'
  99.         aetools.keysubst(_arguments, self._argmap_edit_action_of)
  100.         _arguments['----'] = _object
  101.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  102.         if _arguments.get('errn', 0):
  103.             raise aetools.Error, aetools.decodeerror(_arguments)
  104.         
  105.         if _arguments.has_key('----'):
  106.             return _arguments['----']
  107.         
  108.  
  109.     _argmap_remove_action_from = {
  110.         'using_action_name': 'snam',
  111.         'using_action_number': 'indx' }
  112.     
  113.     def remove_action_from(self, _object, _attributes = { }, **_arguments):
  114.         '''remove action from: Remove a folder action from a folder
  115.         Required argument: the object for the command
  116.         Keyword argument using_action_name: ...or the name of the action to remove
  117.         Keyword argument using_action_number: the index number of the action to remove...
  118.         Keyword argument _attributes: AppleEvent attribute dictionary
  119.         Returns: the reply for the command
  120.         '''
  121.         _code = 'faco'
  122.         _subcode = 'rmfa'
  123.         aetools.keysubst(_arguments, self._argmap_remove_action_from)
  124.         _arguments['----'] = _object
  125.         (_reply, _arguments, _attributes) = self.send(_code, _subcode, _arguments, _attributes)
  126.         if _arguments.get('errn', 0):
  127.             raise aetools.Error, aetools.decodeerror(_arguments)
  128.         
  129.         if _arguments.has_key('----'):
  130.             return _arguments['----']
  131.         
  132.  
  133.  
  134.  
  135. class application(aetools.ComponentItem):
  136.     '''application - The Folder Actions Suite host program '''
  137.     want = 'capp'
  138.  
  139.  
  140. class _Prop__3c_Inheritance_3e_(aetools.NProperty):
  141.     '''<Inheritance> - All of the properties of the superclass. '''
  142.     which = 'c@#^'
  143.     want = 'capp'
  144.  
  145. _3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_()
  146.  
  147. class _Prop_folder_actions_enabled(aetools.NProperty):
  148.     '''folder actions enabled - Are Folder Actions currently being processed? '''
  149.     which = 'faen'
  150.     want = 'bool'
  151.  
  152. folder_actions_enabled = _Prop_folder_actions_enabled()
  153.  
  154. class _Prop_properties(aetools.NProperty):
  155.     '''properties - every property of the Folder Actions Suite host program '''
  156.     which = 'pALL'
  157.     want = '****'
  158.  
  159. properties = _Prop_properties()
  160. applications = application
  161.  
  162. class folder_action(aetools.ComponentItem):
  163.     '''folder action - An action attached to a folder in the file system '''
  164.     want = 'foac'
  165.  
  166.  
  167. class _Prop_name(aetools.NProperty):
  168.     '''name - the name of the folder action, which is also the name of the folder '''
  169.     which = 'pnam'
  170.     want = 'utxt'
  171.  
  172.  
  173. class _Prop_path(aetools.NProperty):
  174.     '''path - the path to the folder to which the folder action applies '''
  175.     which = 'ppth'
  176.     want = '****'
  177.  
  178.  
  179. class _Prop_volume(aetools.NProperty):
  180.     '''volume - the volume on which the folder action resides '''
  181.     which = 'volu'
  182.     want = 'utxt'
  183.  
  184. folder_actions = folder_action
  185.  
  186. class script(aetools.ComponentItem):
  187.     '''script - A script invoked by a folder action '''
  188.     want = 'scpt'
  189.  
  190.  
  191. class _Prop_POSIX_path(aetools.NProperty):
  192.     '''POSIX path - the POSIX file system path of the disk '''
  193.     which = 'posx'
  194.     want = 'utxt'
  195.  
  196. scripts = script
  197. application._superclassnames = []
  198. import Disk_Folder_File_Suite
  199. import Standard_Suite
  200. import Login_Items_Suite
  201. import Processes_Suite
  202. application._privpropdict = {
  203.     '_3c_Inheritance_3e_': _Prop__3c_Inheritance_3e_,
  204.     'folder_actions_enabled': _Prop_folder_actions_enabled,
  205.     'properties': _Prop_properties }
  206. application._privelemdict = {
  207.     'application_process': Processes_Suite.application_process,
  208.     'desk_accessory_process': Processes_Suite.desk_accessory_process,
  209.     'disk': Disk_Folder_File_Suite.disk,
  210.     'document': Standard_Suite.document,
  211.     'file': Disk_Folder_File_Suite.file,
  212.     'folder': Disk_Folder_File_Suite.folder,
  213.     'folder_action': folder_action,
  214.     'item': Disk_Folder_File_Suite.item,
  215.     'login_item': Login_Items_Suite.login_item,
  216.     'process': Processes_Suite.process,
  217.     'window': Standard_Suite.window }
  218. folder_action._superclassnames = [
  219.     'item']
  220. folder_action._privpropdict = {
  221.     '_3c_Inheritance_3e_': _Prop__3c_Inheritance_3e_,
  222.     'name': _Prop_name,
  223.     'path': _Prop_path,
  224.     'properties': _Prop_properties,
  225.     'volume': _Prop_volume }
  226. folder_action._privelemdict = {
  227.     'script': script }
  228. script._superclassnames = [
  229.     'item']
  230. script._privpropdict = {
  231.     'POSIX_path': _Prop_POSIX_path,
  232.     '_3c_Inheritance_3e_': _Prop__3c_Inheritance_3e_,
  233.     'name': _Prop_name,
  234.     'path': _Prop_path,
  235.     'properties': _Prop_properties }
  236. script._privelemdict = { }
  237. _Enum_actn = {
  238.     'items_added': 'fget',
  239.     'items_removed': 'flos',
  240.     'window_closed': 'fclo',
  241.     'window_moved': 'fsiz',
  242.     'window_opened': 'fopn' }
  243. _classdeclarations = {
  244.     'capp': application,
  245.     'foac': folder_action,
  246.     'scpt': script }
  247. _propdeclarations = {
  248.     'c@#^': _Prop__3c_Inheritance_3e_,
  249.     'faen': _Prop_folder_actions_enabled,
  250.     'pALL': _Prop_properties,
  251.     'pnam': _Prop_name,
  252.     'posx': _Prop_POSIX_path,
  253.     'ppth': _Prop_path,
  254.     'volu': _Prop_volume }
  255. _compdeclarations = { }
  256. _enumdeclarations = {
  257.     'actn': _Enum_actn }
  258.