1"""Suite Disk-Folder-File Suite: Terms and Events for controlling Disks, Folders, and Files 2Level 1, version 1 3 4Generated from /System/Library/CoreServices/System Events.app 5AETE/AEUT resource version 1/0, language 0, script 0 6""" 7 8import aetools 9import MacOS 10 11_code = 'cdis' 12 13class Disk_Folder_File_Suite_Events: 14 15 _argmap_move = { 16 'to' : 'insh', 17 } 18 19 def move(self, _object, _attributes={}, **_arguments): 20 """move: Move disk item(s) to a new location. 21 Required argument: the object for the command 22 Keyword argument to: The new location for the disk item(s). 23 Keyword argument _attributes: AppleEvent attribute dictionary 24 Returns: the reply for the command 25 """ 26 _code = 'core' 27 _subcode = 'move' 28 29 aetools.keysubst(_arguments, self._argmap_move) 30 _arguments['----'] = _object 31 32 33 _reply, _arguments, _attributes = self.send(_code, _subcode, 34 _arguments, _attributes) 35 if _arguments.get('errn', 0): 36 raise aetools.Error, aetools.decodeerror(_arguments) 37 # XXXX Optionally decode result 38 if _arguments.has_key('----'): 39 return _arguments['----'] 40 41 42class application(aetools.ComponentItem): 43 """application - The Disk-Folder-File Suite host program """ 44 want = 'capp' 45class _Prop__3c_Inheritance_3e_(aetools.NProperty): 46 """<Inheritance> - All of the properties of the superclass. """ 47 which = 'c@#^' 48 want = 'capp' 49_3c_Inheritance_3e_ = _Prop__3c_Inheritance_3e_() 50class _Prop_folder_actions_enabled(aetools.NProperty): 51 """folder actions enabled - Are Folder Actions currently being processed? """ 52 which = 'faen' 53 want = 'bool' 54folder_actions_enabled = _Prop_folder_actions_enabled() 55class _Prop_properties(aetools.NProperty): 56 """properties - every property of the Disk-Folder-File Suite host program """ 57 which = 'pALL' 58 want = '****' 59properties = _Prop_properties() 60# element 'cdis' as ['name', 'indx', 'rele', 'rang', 'test'] 61# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] 62# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] 63# element 'cwin' as ['name', 'indx', 'rele', 'rang', 'test', 'ID '] 64# element 'docu' as ['name', 'indx', 'rele', 'rang', 'test'] 65# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] 66# element 'foac' as ['name', 'indx', 'rele', 'rang', 'test'] 67# element 'logi' as ['name', 'indx', 'rele', 'rang', 'test'] 68# element 'pcap' as ['name', 'indx', 'rele', 'rang', 'test'] 69# element 'pcda' as ['name', 'indx', 'rele', 'rang', 'test'] 70# element 'prcs' as ['name', 'indx', 'rele', 'rang', 'test'] 71 72applications = application 73 74class disk(aetools.ComponentItem): 75 """disk - A disk in the file system """ 76 want = 'cdis' 77class _Prop_POSIX_path(aetools.NProperty): 78 """POSIX path - the POSIX file system path of the disk """ 79 which = 'posx' 80 want = 'utxt' 81class _Prop_capacity(aetools.NProperty): 82 """capacity - the total number of bytes (free or used) on the disk """ 83 which = 'capa' 84 want = 'magn' 85class _Prop_ejectable(aetools.NProperty): 86 """ejectable - Can the media be ejected (floppies, CD's, and so on)? """ 87 which = 'isej' 88 want = 'bool' 89class _Prop_format(aetools.NProperty): 90 """format - the file system format of this disk """ 91 which = 'dfmt' 92 want = 'edfm' 93class _Prop_free_space(aetools.NProperty): 94 """free space - the number of free bytes left on the disk """ 95 which = 'frsp' 96 want = 'magn' 97class _Prop_ignore_privileges(aetools.NProperty): 98 """ignore privileges - Ignore permissions on this disk? """ 99 which = 'igpr' 100 want = 'bool' 101class _Prop_local_volume(aetools.NProperty): 102 """local volume - Is the media a local volume (as opposed to a file server? """ 103 which = 'isrv' 104 want = 'bool' 105class _Prop_name(aetools.NProperty): 106 """name - the name of the disk """ 107 which = 'pnam' 108 want = 'utxt' 109class _Prop_path(aetools.NProperty): 110 """path - the file system path of the disk """ 111 which = 'ppth' 112 want = 'utxt' 113class _Prop_startup(aetools.NProperty): 114 """startup - Is this disk the boot disk? """ 115 which = 'istd' 116 want = 'bool' 117class _Prop_volume(aetools.NProperty): 118 """volume - the volume on which the folder resides """ 119 which = 'volu' 120 want = 'utxt' 121# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] 122# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] 123# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] 124 125disks = disk 126 127class folder(aetools.ComponentItem): 128 """folder - A folder in the file system """ 129 want = 'cfol' 130# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] 131# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] 132# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] 133# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] 134# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] 135# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] 136 137folders = folder 138 139class item(aetools.ComponentItem): 140 """item - An item in the file system """ 141 want = 'cobj' 142class _Prop_busy_status(aetools.NProperty): 143 """busy status - Is the item busy? """ 144 which = 'busy' 145 want = 'bool' 146class _Prop_creation_date(aetools.NProperty): 147 """creation date - the date on which the item was created """ 148 which = 'ascd' 149 want = '****' 150class _Prop_modification_date(aetools.NProperty): 151 """modification date - the date on which the item was last modified """ 152 which = 'asmo' 153 want = '****' 154class _Prop_name_extension(aetools.NProperty): 155 """name extension - the extension portion of the name """ 156 which = 'extn' 157 want = 'utxt' 158class _Prop_package_folder(aetools.NProperty): 159 """package folder - Is the item a package? """ 160 which = 'pkgf' 161 want = 'bool' 162class _Prop_url(aetools.NProperty): 163 """url - the url of the item """ 164 which = 'url ' 165 want = 'utxt' 166class _Prop_visible(aetools.NProperty): 167 """visible - Is the item visible? """ 168 which = 'visi' 169 want = 'bool' 170# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] 171# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] 172# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] 173 174items = item 175 176class file(aetools.ComponentItem): 177 """file - A file in the file system """ 178 want = 'file' 179class _Prop_creator_type(aetools.NProperty): 180 """creator type - the OSType identifying the application that created the item """ 181 which = 'fcrt' 182 want = 'utxt' 183class _Prop_file_type(aetools.NProperty): 184 """file type - the OSType identifying the type of data contained in the item """ 185 which = 'asty' 186 want = 'utxt' 187class _Prop_physical_size(aetools.NProperty): 188 """physical size - the actual space used by the file on disk """ 189 which = 'phys' 190 want = 'magn' 191class _Prop_product_version(aetools.NProperty): 192 """product version - the version of the product (visible at the top of the ?et Info?window) """ 193 which = 'ver2' 194 want = 'utxt' 195class _Prop_size(aetools.NProperty): 196 """size - the logical size of the file """ 197 which = 'ptsz' 198 want = 'magn' 199class _Prop_stationery(aetools.NProperty): 200 """stationery - Is the file a stationery pad? """ 201 which = 'pspd' 202 want = 'bool' 203class _Prop_version(aetools.NProperty): 204 """version - the version of the file (visible at the bottom of the ?et Info?window) """ 205 which = 'vers' 206 want = 'utxt' 207# element 'cfol' as ['name', 'indx', 'rele', 'rang', 'test'] 208# element 'cobj' as ['name', 'indx', 'rele', 'rang', 'test'] 209# element 'file' as ['name', 'indx', 'rele', 'rang', 'test'] 210 211files = file 212application._superclassnames = [] 213import Standard_Suite 214import Folder_Actions_Suite 215import Login_Items_Suite 216import Processes_Suite 217application._privpropdict = { 218 '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, 219 'folder_actions_enabled' : _Prop_folder_actions_enabled, 220 'properties' : _Prop_properties, 221} 222application._privelemdict = { 223 'application_process' : Processes_Suite.application_process, 224 'desk_accessory_process' : Processes_Suite.desk_accessory_process, 225 'disk' : disk, 226 'document' : Standard_Suite.document, 227 'file' : file, 228 'folder' : folder, 229 'folder_action' : Folder_Actions_Suite.folder_action, 230 'item' : item, 231 'login_item' : Login_Items_Suite.login_item, 232 'process' : Processes_Suite.process, 233 'window' : Standard_Suite.window, 234} 235disk._superclassnames = ['item'] 236disk._privpropdict = { 237 'POSIX_path' : _Prop_POSIX_path, 238 '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, 239 'capacity' : _Prop_capacity, 240 'ejectable' : _Prop_ejectable, 241 'format' : _Prop_format, 242 'free_space' : _Prop_free_space, 243 'ignore_privileges' : _Prop_ignore_privileges, 244 'local_volume' : _Prop_local_volume, 245 'name' : _Prop_name, 246 'path' : _Prop_path, 247 'properties' : _Prop_properties, 248 'startup' : _Prop_startup, 249 'volume' : _Prop_volume, 250} 251disk._privelemdict = { 252 'file' : file, 253 'folder' : folder, 254 'item' : item, 255} 256folder._superclassnames = ['item'] 257folder._privpropdict = { 258 'POSIX_path' : _Prop_POSIX_path, 259 '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, 260 'name' : _Prop_name, 261 'path' : _Prop_path, 262 'properties' : _Prop_properties, 263 'volume' : _Prop_volume, 264} 265folder._privelemdict = { 266 'file' : file, 267 'file' : file, 268 'folder' : folder, 269 'folder' : folder, 270 'item' : item, 271 'item' : item, 272} 273item._superclassnames = [] 274item._privpropdict = { 275 'POSIX_path' : _Prop_POSIX_path, 276 '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, 277 'busy_status' : _Prop_busy_status, 278 'creation_date' : _Prop_creation_date, 279 'modification_date' : _Prop_modification_date, 280 'name' : _Prop_name, 281 'name_extension' : _Prop_name_extension, 282 'package_folder' : _Prop_package_folder, 283 'path' : _Prop_path, 284 'properties' : _Prop_properties, 285 'url' : _Prop_url, 286 'visible' : _Prop_visible, 287 'volume' : _Prop_volume, 288} 289item._privelemdict = { 290 'file' : file, 291 'folder' : folder, 292 'item' : item, 293} 294file._superclassnames = ['item'] 295file._privpropdict = { 296 'POSIX_path' : _Prop_POSIX_path, 297 '_3c_Inheritance_3e_' : _Prop__3c_Inheritance_3e_, 298 'creator_type' : _Prop_creator_type, 299 'file_type' : _Prop_file_type, 300 'name' : _Prop_name, 301 'path' : _Prop_path, 302 'physical_size' : _Prop_physical_size, 303 'product_version' : _Prop_product_version, 304 'properties' : _Prop_properties, 305 'size' : _Prop_size, 306 'stationery' : _Prop_stationery, 307 'version' : _Prop_version, 308 'volume' : _Prop_volume, 309} 310file._privelemdict = { 311 'file' : file, 312 'folder' : folder, 313 'item' : item, 314} 315_Enum_edfm = { 316 'MS_2d_DOS_format' : 'dfms', # MS-DOS format 317 'Apple_Photo_format' : 'dfph', # Apple Photo format 318 'ISO_9660_format' : 'df96', # ISO 9660 format 319 'QuickTake_format' : 'dfqt', # QuickTake format 320 'AppleShare_format' : 'dfas', # AppleShare format 321 'High_Sierra_format' : 'dfhs', # High Sierra format 322 'Mac_OS_Extended_format' : 'dfh+', # Mac OS Extended format 323 'UDF_format' : 'dfud', # UDF format 324 'unknown_format' : 'df??', # unknown format 325 'audio_format' : 'dfau', # audio format 326 'Mac_OS_format' : 'dfhf', # Mac OS format 327 'UFS_format' : 'dfuf', # UFS format 328 'NFS_format' : 'dfnf', # NFS format 329 'ProDOS_format' : 'dfpr', # ProDOS format 330 'WebDAV_format' : 'dfwd', # WebDAV format 331} 332 333 334# 335# Indices of types declared in this module 336# 337_classdeclarations = { 338 'capp' : application, 339 'cdis' : disk, 340 'cfol' : folder, 341 'cobj' : item, 342 'file' : file, 343} 344 345_propdeclarations = { 346 'ascd' : _Prop_creation_date, 347 'asmo' : _Prop_modification_date, 348 'asty' : _Prop_file_type, 349 'busy' : _Prop_busy_status, 350 'c@#^' : _Prop__3c_Inheritance_3e_, 351 'capa' : _Prop_capacity, 352 'dfmt' : _Prop_format, 353 'extn' : _Prop_name_extension, 354 'faen' : _Prop_folder_actions_enabled, 355 'fcrt' : _Prop_creator_type, 356 'frsp' : _Prop_free_space, 357 'igpr' : _Prop_ignore_privileges, 358 'isej' : _Prop_ejectable, 359 'isrv' : _Prop_local_volume, 360 'istd' : _Prop_startup, 361 'pALL' : _Prop_properties, 362 'phys' : _Prop_physical_size, 363 'pkgf' : _Prop_package_folder, 364 'pnam' : _Prop_name, 365 'posx' : _Prop_POSIX_path, 366 'ppth' : _Prop_path, 367 'pspd' : _Prop_stationery, 368 'ptsz' : _Prop_size, 369 'url ' : _Prop_url, 370 'ver2' : _Prop_product_version, 371 'vers' : _Prop_version, 372 'visi' : _Prop_visible, 373 'volu' : _Prop_volume, 374} 375 376_compdeclarations = { 377} 378 379_enumdeclarations = { 380 'edfm' : _Enum_edfm, 381} 382