/Mac/Demo/applescript/Disk_Copy/Utility_Events.py

http://unladen-swallow.googlecode.com/ · Python · 213 lines · 205 code · 0 blank · 8 comment · 0 complexity · bcaede5f6c1309863bebf1de2c71b861 MD5 · raw file

  1. """Suite Utility Events: Commands that allow the user to select Disk Copy files
  2. Level 1, version 1
  3. Generated from Macintosh HD:Hulpprogramma's:Disk Copy
  4. AETE/AEUT resource version 1/0, language 0, script 0
  5. """
  6. import aetools
  7. import MacOS
  8. _code = 'ddsk'
  9. class Utility_Events_Events:
  10. _argmap_select_disk_image = {
  11. 'with_prompt' : 'SELp',
  12. }
  13. def select_disk_image(self, _no_object=None, _attributes={}, **_arguments):
  14. """select disk image: Prompt the user to select a disk image
  15. Keyword argument with_prompt: the prompt string to be displayed
  16. Keyword argument _attributes: AppleEvent attribute dictionary
  17. Returns: a reference to a disk image
  18. """
  19. _code = 'UTIL'
  20. _subcode = 'SEL1'
  21. aetools.keysubst(_arguments, self._argmap_select_disk_image)
  22. if _no_object is not None: raise TypeError, 'No direct arg expected'
  23. aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
  24. _reply, _arguments, _attributes = self.send(_code, _subcode,
  25. _arguments, _attributes)
  26. if _arguments.has_key('errn'):
  27. raise aetools.Error, aetools.decodeerror(_arguments)
  28. # XXXX Optionally decode result
  29. if _arguments.has_key('----'):
  30. return _arguments['----']
  31. _argmap_select_DiskScript = {
  32. 'with_prompt' : 'SELp',
  33. }
  34. def select_DiskScript(self, _no_object=None, _attributes={}, **_arguments):
  35. """select DiskScript: Prompt the user to select a DiskScript
  36. Keyword argument with_prompt: the prompt string to be displayed
  37. Keyword argument _attributes: AppleEvent attribute dictionary
  38. Returns: a reference to a DiskScript
  39. """
  40. _code = 'UTIL'
  41. _subcode = 'SEL2'
  42. aetools.keysubst(_arguments, self._argmap_select_DiskScript)
  43. if _no_object is not None: raise TypeError, 'No direct arg expected'
  44. aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
  45. _reply, _arguments, _attributes = self.send(_code, _subcode,
  46. _arguments, _attributes)
  47. if _arguments.has_key('errn'):
  48. raise aetools.Error, aetools.decodeerror(_arguments)
  49. # XXXX Optionally decode result
  50. if _arguments.has_key('----'):
  51. return _arguments['----']
  52. _argmap_select_disk_image_or_DiskScript = {
  53. 'with_prompt' : 'SELp',
  54. }
  55. def select_disk_image_or_DiskScript(self, _no_object=None, _attributes={}, **_arguments):
  56. """select disk image or DiskScript: Prompt the user to select a disk image or DiskScript
  57. Keyword argument with_prompt: the prompt string to be displayed
  58. Keyword argument _attributes: AppleEvent attribute dictionary
  59. Returns: a reference to disk image or a DiskScript
  60. """
  61. _code = 'UTIL'
  62. _subcode = 'SEL3'
  63. aetools.keysubst(_arguments, self._argmap_select_disk_image_or_DiskScript)
  64. if _no_object is not None: raise TypeError, 'No direct arg expected'
  65. aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
  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. _argmap_select_floppy_disk_image = {
  74. 'with_prompt' : 'SELp',
  75. }
  76. def select_floppy_disk_image(self, _no_object=None, _attributes={}, **_arguments):
  77. """select floppy disk image: Prompt the user to select a floppy disk image
  78. Keyword argument with_prompt: the prompt string to be displayed
  79. Keyword argument _attributes: AppleEvent attribute dictionary
  80. Returns: a reference to a floppy disk image
  81. """
  82. _code = 'UTIL'
  83. _subcode = 'SEL4'
  84. aetools.keysubst(_arguments, self._argmap_select_floppy_disk_image)
  85. if _no_object is not None: raise TypeError, 'No direct arg expected'
  86. aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
  87. _reply, _arguments, _attributes = self.send(_code, _subcode,
  88. _arguments, _attributes)
  89. if _arguments.has_key('errn'):
  90. raise aetools.Error, aetools.decodeerror(_arguments)
  91. # XXXX Optionally decode result
  92. if _arguments.has_key('----'):
  93. return _arguments['----']
  94. _argmap_select_disk = {
  95. 'with_prompt' : 'SELp',
  96. }
  97. def select_disk(self, _no_object=None, _attributes={}, **_arguments):
  98. """select disk: Prompt the user to select a disk volume
  99. Keyword argument with_prompt: the prompt string to be displayed
  100. Keyword argument _attributes: AppleEvent attribute dictionary
  101. Returns: a reference to the disk
  102. """
  103. _code = 'UTIL'
  104. _subcode = 'SEL5'
  105. aetools.keysubst(_arguments, self._argmap_select_disk)
  106. if _no_object is not None: raise TypeError, 'No direct arg expected'
  107. aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
  108. _reply, _arguments, _attributes = self.send(_code, _subcode,
  109. _arguments, _attributes)
  110. if _arguments.has_key('errn'):
  111. raise aetools.Error, aetools.decodeerror(_arguments)
  112. # XXXX Optionally decode result
  113. if _arguments.has_key('----'):
  114. return _arguments['----']
  115. _argmap_select_folder = {
  116. 'with_prompt' : 'SELp',
  117. }
  118. def select_folder(self, _no_object=None, _attributes={}, **_arguments):
  119. """select folder: Prompt the user to select a folder
  120. Keyword argument with_prompt: the prompt string to be displayed
  121. Keyword argument _attributes: AppleEvent attribute dictionary
  122. Returns: a reference to the folder
  123. """
  124. _code = 'UTIL'
  125. _subcode = 'SEL6'
  126. aetools.keysubst(_arguments, self._argmap_select_folder)
  127. if _no_object is not None: raise TypeError, 'No direct arg expected'
  128. aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
  129. _reply, _arguments, _attributes = self.send(_code, _subcode,
  130. _arguments, _attributes)
  131. if _arguments.has_key('errn'):
  132. raise aetools.Error, aetools.decodeerror(_arguments)
  133. # XXXX Optionally decode result
  134. if _arguments.has_key('----'):
  135. return _arguments['----']
  136. _argmap_log = {
  137. 'time_stamp' : 'TSMP',
  138. }
  139. def log(self, _object, _attributes={}, **_arguments):
  140. """log: Add a string to the log window
  141. Required argument: the string to add to the log window
  142. Keyword argument time_stamp: Should the log entry be time-stamped? (false if not supplied)
  143. Keyword argument _attributes: AppleEvent attribute dictionary
  144. """
  145. _code = 'UTIL'
  146. _subcode = 'LOG '
  147. aetools.keysubst(_arguments, self._argmap_log)
  148. _arguments['----'] = _object
  149. aetools.enumsubst(_arguments, 'TSMP', _Enum_bool)
  150. _reply, _arguments, _attributes = self.send(_code, _subcode,
  151. _arguments, _attributes)
  152. if _arguments.has_key('errn'):
  153. raise aetools.Error, aetools.decodeerror(_arguments)
  154. # XXXX Optionally decode result
  155. if _arguments.has_key('----'):
  156. return _arguments['----']
  157. _Enum_TEXT = None # XXXX enum TEXT not found!!
  158. _Enum_bool = None # XXXX enum bool not found!!
  159. #
  160. # Indices of types declared in this module
  161. #
  162. _classdeclarations = {
  163. }
  164. _propdeclarations = {
  165. }
  166. _compdeclarations = {
  167. }
  168. _enumdeclarations = {
  169. }