Standard_Suite.py 16.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
"""Suite Standard Suite: Common terms for most applications
Level 1, version 1

Generated from Macintosh HD:Hulpprogramma's:Disk Copy
AETE/AEUT resource version 1/0, language 0, script 0
"""

import aetools
import MacOS

_code = 'Core'

class Standard_Suite_Events:

15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
    _argmap_save = {
            '_in' : 'kfil',
            'using_format' : 'SvAs',
            'checksum_verification' : 'VChk',
            'signature_verification' : 'VSig',
            'image_signing' : 'SImg',
            'leave_image_mounted' : 'Moun',
            'percent_free_space' : 'Slop',
            'logical_blocks' : 'Blks',
            'zeroing' : 'Zero',
    }

    def save(self, _object, _attributes={}, **_arguments):
        """save: Save an object
        Required argument: the source object
        Keyword argument _in: the target object
        Keyword argument using_format: the format for the target
        Keyword argument checksum_verification: Should the checksum be verified before saving?
        Keyword argument signature_verification: Should the DigiSign signature be verified before saving?
        Keyword argument image_signing: Should the image be signed?
        Keyword argument leave_image_mounted: Should the image be mounted after saving?
        Keyword argument percent_free_space: percent free space to reserve (for image folder operation, 0-255%)
        Keyword argument logical_blocks: number of logical blocks in the image (for image folder operation)
        Keyword argument zeroing: Should all the blocks in the image be set to zeros? (for image folder operation)
        Keyword argument _attributes: AppleEvent attribute dictionary
        Returns: the result of the save operation
        """
        _code = 'core'
        _subcode = 'save'

        aetools.keysubst(_arguments, self._argmap_save)
        _arguments['----'] = _object

        aetools.enumsubst(_arguments, 'kfil', _Enum_obj_)
        aetools.enumsubst(_arguments, 'SvAs', _Enum_SvAs)
        aetools.enumsubst(_arguments, 'VChk', _Enum_bool)
        aetools.enumsubst(_arguments, 'VSig', _Enum_bool)
        aetools.enumsubst(_arguments, 'SImg', _Enum_bool)
        aetools.enumsubst(_arguments, 'Moun', _Enum_bool)
        aetools.enumsubst(_arguments, 'Slop', _Enum_long)
        aetools.enumsubst(_arguments, 'Blks', _Enum_long)
        aetools.enumsubst(_arguments, 'Zero', _Enum_bool)

        _reply, _arguments, _attributes = self.send(_code, _subcode,
                        _arguments, _attributes)
        if _arguments.has_key('errn'):
            raise aetools.Error, aetools.decodeerror(_arguments)
        # XXXX Optionally decode result
        if _arguments.has_key('----'):
            return _arguments['----']

    def do_script(self, _object, _attributes={}, **_arguments):
        """do script: Execute an attached script located in the folder "Scripts"
        Required argument: the script to be executed
        Keyword argument _attributes: AppleEvent attribute dictionary
        """
        _code = 'core'
        _subcode = 'dosc'

        if _arguments: raise TypeError, 'No optional args expected'
        _arguments['----'] = _object


        _reply, _arguments, _attributes = self.send(_code, _subcode,
                        _arguments, _attributes)
        if _arguments.has_key('errn'):
            raise aetools.Error, aetools.decodeerror(_arguments)
        # XXXX Optionally decode result
        if _arguments.has_key('----'):
            return _arguments['----']
85 86 87


class application(aetools.ComponentItem):
88 89
    """application - The Disk Copy application """
    want = 'capp'
90
class version(aetools.NProperty):
91 92 93
    """version - the version of this application """
    which = 'vers'
    want = 'vers'
94
class name(aetools.NProperty):
95 96 97
    """name - the name of this application """
    which = 'pnam'
    want = 'TEXT'
98
class comment(aetools.NProperty):
99 100 101
    """comment - the comment associated with the application """
    which = 'comt'
    want = 'TEXT'
102
class driver_version(aetools.NProperty):
103 104 105
    """driver version - the version of the disk image driver """
    which = 'dVer'
    want = 'vers'
106
class nonejectable_mode(aetools.NProperty):
107 108 109
    """nonejectable mode - Should mounted images be non-ejectable? """
    which = 'otto'
    want = 'bool'
110
class save_log_file(aetools.NProperty):
111 112 113
    """save log file - Should the log file be saved on disk? """
    which = 'PSaL'
    want = 'bool'
114
class use_speech(aetools.NProperty):
115 116 117
    """use speech - Should Disk Copy use spoken feedback? """
    which = 'PTlk'
    want = 'bool'
118
class smart_Save_As(aetools.NProperty):
119 120 121
    """smart Save As - Should the Save As... dialog box automatically go to the right folder? """
    which = 'PSSP'
    want = 'bool'
122
class checksum_verification(aetools.NProperty):
123 124 125
    """checksum verification - Should image checksums be verified? """
    which = 'PVeC'
    want = 'bool'
126
class signature_verification(aetools.NProperty):
127 128 129
    """signature verification - Should digital signatures be verified? """
    which = 'PVeS'
    want = 'bool'
130
class exclude_DiskScripts(aetools.NProperty):
131 132 133
    """exclude DiskScripts - Should images referenced in DiskScripts/DiskSets be excluded from verification? """
    which = 'PExD'
    want = 'bool'
134
class exclude_remote_images(aetools.NProperty):
135 136 137
    """exclude remote images - Should images that are located on network volumes be excluded from verification? """
    which = 'PExR'
    want = 'bool'
138
class image_signing(aetools.NProperty):
139 140 141
    """image signing - Should images be signed with a digital signature? """
    which = 'PSiI'
    want = 'bool'
142
class leave_image_mounted(aetools.NProperty):
143 144 145
    """leave image mounted - Should images be mounted after they are created? """
    which = 'PMoA'
    want = 'bool'
146
class erase_confirmation(aetools.NProperty):
147 148 149
    """erase confirmation - Should the user be required to confirm commands that erase disks? """
    which = 'PCoE'
    want = 'bool'
150
class zeroing(aetools.NProperty):
151 152 153
    """zeroing - Should all blocks of a new image be set to zero? """
    which = 'PZeB'
    want = 'bool'
154
class default_create_size(aetools.NProperty):
155 156 157
    """default create size - the default size for a new image, in blocks (512 bytes per block) """
    which = 'PDeS'
    want = 'long'
158
class default_create_name(aetools.NProperty):
159 160 161
    """default create name - the default volume name for a new image """
    which = 'PDeN'
    want = 'TEXT'
162
class make_multiple_floppies(aetools.NProperty):
163 164 165
    """make multiple floppies - Should the user be prompted to make multiple floppy disk images at a time? """
    which = 'PBuM'
    want = 'bool'
166
class auto_image_upon_insert(aetools.NProperty):
167 168 169
    """auto image upon insert - Should a newly-inserted disk automatically be processed into an image? """
    which = 'Paim'
    want = 'bool'
170
class eject_after_auto_image(aetools.NProperty):
171 172 173
    """eject after auto image - Should auto-imaged disks be ejected afterwards? """
    which = 'Pejc'
    want = 'bool'
174
class auto_copy_upon_floppy_insert(aetools.NProperty):
175 176 177
    """auto copy upon floppy insert - Instead of auto-imaging, should newly-inserted floppy disks be copied? """
    which = 'Pcpf'
    want = 'bool'
178
class volume_suffix(aetools.NProperty):
179 180 181
    """volume suffix - the default volume name suffix """
    which = 'PDiE'
    want = 'TEXT'
182
class image_suffix(aetools.NProperty):
183 184 185
    """image suffix - the default image name suffix """
    which = 'PImE'
    want = 'TEXT'
186
class default_file_system(aetools.NProperty):
187 188 189
    """default file system - the default file system type for new blank images """
    which = 'Pfsy'
    want = 'Fsys'
190
class default_image_format(aetools.NProperty):
191 192 193
    """default image format - the default image file format """
    which = 'Pdfm'
    want = 'SvAs'
194 195

class disk(aetools.ComponentItem):
196 197
    """disk - A mounted volume """
    want = 'Disk'
198 199 200 201 202

name = name

comment = comment
class locked(aetools.NProperty):
203 204 205
    """locked - Is the disk locked? """
    which = 'islk'
    want = 'bool'
206
class creation_date(aetools.NProperty):
207 208 209
    """creation date - the creation date of disk """
    which = 'ascd'
    want = 'ldt '
210
class modification_date(aetools.NProperty):
211 212 213
    """modification date - the modification date of disk """
    which = 'asmo'
    want = 'ldt '
214
class crc32_checksum(aetools.NProperty):
215 216 217
    """crc32 checksum - the crc-32 checksum of the disk """
    which = 'Xcrc'
    want = 'TEXT'
218
class disk_copy_4_2e_2_checksum(aetools.NProperty):
219 220 221
    """disk copy 4.2 checksum - the Disk Copy 4.2 checksum of the disk """
    which = 'Xc42'
    want = 'TEXT'
222
class block_count(aetools.NProperty):
223 224 225
    """block count - the number of blocks on disk """
    which = 'Xblk'
    want = 'long'
226
class file_system(aetools.NProperty):
227 228 229
    """file system - the file system used on disk """
    which = 'Xfsi'
    want = 'TEXT'
230 231

class folder(aetools.ComponentItem):
232 233
    """folder - A folder or directory on a disk """
    want = 'Fold'
234 235 236 237 238 239 240 241 242 243

name = name

comment = comment

creation_date = creation_date

modification_date = modification_date

class disk_image(aetools.ComponentItem):
244 245
    """disk image - A disk image file """
    want = 'DImg'
246 247 248 249 250 251 252 253 254 255 256

name = name

comment = comment

locked = locked

creation_date = creation_date

modification_date = modification_date
class file_format(aetools.NProperty):
257 258 259
    """file format - the format of the disk image file """
    which = 'Ifmt'
    want = 'TEXT'
260
class signed(aetools.NProperty):
261 262 263
    """signed - Does the disk image have a DigiSign signature? """
    which = 'Isin'
    want = 'bool'
264
class compressed(aetools.NProperty):
265 266 267
    """compressed - Is the disk image compressed? """
    which = 'Icom'
    want = 'bool'
268
class segmented(aetools.NProperty):
269 270 271
    """segmented - Is the disk image segmented? """
    which = 'Iseg'
    want = 'bool'
272
class segments(aetools.NProperty):
273 274 275
    """segments - a list of references to other segments that make up a complete image """
    which = 'Isg#'
    want = 'fss '
276
class disk_name(aetools.NProperty):
277 278 279
    """disk name - the name of the disk this image represents """
    which = 'Idnm'
    want = 'TEXT'
280 281 282 283 284 285 286 287 288

crc32_checksum = crc32_checksum

disk_copy_4_2e_2_checksum = disk_copy_4_2e_2_checksum

block_count = block_count

file_system = file_system
class data_fork_size(aetools.NProperty):
289 290 291
    """data fork size - the size (in bytes) of the data fork of the disk image """
    which = 'Idfk'
    want = 'long'
292
class resource_fork_size(aetools.NProperty):
293 294 295
    """resource fork size - the size (in bytes) of the resource fork of the disk image """
    which = 'Irfk'
    want = 'long'
296 297

class Save_reply_record(aetools.ComponentItem):
298 299
    """Save reply record - Result from the save operation """
    want = 'cpyR'
300
class resulting_target_object(aetools.NProperty):
301 302 303
    """resulting target object - a reference to the target object after it has been saved """
    which = 'rcpO'
    want = 'obj '
304
class copy_type(aetools.NProperty):
305 306 307
    """copy type - the way in which the target object was saved """
    which = 'rcpT'
    want = 'rcpT'
308
application._propdict = {
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334
        'version' : version,
        'name' : name,
        'comment' : comment,
        'driver_version' : driver_version,
        'nonejectable_mode' : nonejectable_mode,
        'save_log_file' : save_log_file,
        'use_speech' : use_speech,
        'smart_Save_As' : smart_Save_As,
        'checksum_verification' : checksum_verification,
        'signature_verification' : signature_verification,
        'exclude_DiskScripts' : exclude_DiskScripts,
        'exclude_remote_images' : exclude_remote_images,
        'image_signing' : image_signing,
        'leave_image_mounted' : leave_image_mounted,
        'erase_confirmation' : erase_confirmation,
        'zeroing' : zeroing,
        'default_create_size' : default_create_size,
        'default_create_name' : default_create_name,
        'make_multiple_floppies' : make_multiple_floppies,
        'auto_image_upon_insert' : auto_image_upon_insert,
        'eject_after_auto_image' : eject_after_auto_image,
        'auto_copy_upon_floppy_insert' : auto_copy_upon_floppy_insert,
        'volume_suffix' : volume_suffix,
        'image_suffix' : image_suffix,
        'default_file_system' : default_file_system,
        'default_image_format' : default_image_format,
335 336 337 338
}
application._elemdict = {
}
disk._propdict = {
339 340 341 342 343 344 345 346 347
        'name' : name,
        'comment' : comment,
        'locked' : locked,
        'creation_date' : creation_date,
        'modification_date' : modification_date,
        'crc32_checksum' : crc32_checksum,
        'disk_copy_4_2e_2_checksum' : disk_copy_4_2e_2_checksum,
        'block_count' : block_count,
        'file_system' : file_system,
348 349 350 351
}
disk._elemdict = {
}
folder._propdict = {
352 353 354 355
        'name' : name,
        'comment' : comment,
        'creation_date' : creation_date,
        'modification_date' : modification_date,
356 357 358 359
}
folder._elemdict = {
}
disk_image._propdict = {
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376
        'name' : name,
        'comment' : comment,
        'locked' : locked,
        'creation_date' : creation_date,
        'modification_date' : modification_date,
        'file_format' : file_format,
        'signed' : signed,
        'compressed' : compressed,
        'segmented' : segmented,
        'segments' : segments,
        'disk_name' : disk_name,
        'crc32_checksum' : crc32_checksum,
        'disk_copy_4_2e_2_checksum' : disk_copy_4_2e_2_checksum,
        'block_count' : block_count,
        'file_system' : file_system,
        'data_fork_size' : data_fork_size,
        'resource_fork_size' : resource_fork_size,
377 378 379 380
}
disk_image._elemdict = {
}
Save_reply_record._propdict = {
381 382
        'resulting_target_object' : resulting_target_object,
        'copy_type' : copy_type,
383 384 385 386
}
Save_reply_record._elemdict = {
}
_Enum_UIAc = {
387 388 389 390
        'never_interact' : 'eNvr',      # Dont allow any interaction at all
        'interact_with_self' : 'eInS',  # Only allow interaction from internal events
        'interact_with_local' : 'eInL', # Allow interaction from any event originating on this machine
        'interact_with_all' : 'eInA',   # Allow interaction from network events
391 392 393
}

_Enum_SvAs = {
394 395 396 397
        'NDIF_RW' : 'RdWr',     # read/write NDIF disk image
        'NDIF_RO' : 'Rdxx',     # read-only NDIF disk image
        'NDIF_Compressed' : 'ROCo',     # compressed NDIF disk image
        'Disk_Copy_4_2e_2' : 'DC42',    # Disk Copy 4.2 disk image
398 399 400
}

_Enum_rcpT = {
401 402 403 404 405 406
        'block_disk_copy' : 'cpBl',     # block-by-block disk-level copy
        'files_and_file_ID_copy' : 'cpID',      # all files including desktop databases and file IDs
        'files_and_desktop_info' : 'cpDT',      # all files and most desktop information
        'files_only' : 'cpFI',  # all files but no desktop information
        'disk_image_conversion' : 'cpCV',       # disk image format conversion
        'disk_image_creation' : 'cpCR', # disk image creation
407 408 409 410 411 412 413 414 415 416
}

_Enum_long = None # XXXX enum long not found!!
_Enum_bool = None # XXXX enum bool not found!!
_Enum_obj_ = None # XXXX enum obj  not found!!

#
# Indices of types declared in this module
#
_classdeclarations = {
417 418 419 420 421
        'DImg' : disk_image,
        'capp' : application,
        'Disk' : disk,
        'Fold' : folder,
        'cpyR' : Save_reply_record,
422 423 424
}

_propdeclarations = {
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
        'Xcrc' : crc32_checksum,
        'PDeS' : default_create_size,
        'Idnm' : disk_name,
        'PSSP' : smart_Save_As,
        'Pcpf' : auto_copy_upon_floppy_insert,
        'pnam' : name,
        'Isin' : signed,
        'otto' : nonejectable_mode,
        'PExD' : exclude_DiskScripts,
        'Iseg' : segmented,
        'islk' : locked,
        'asmo' : modification_date,
        'PTlk' : use_speech,
        'Pfsy' : default_file_system,
        'PVeC' : checksum_verification,
        'Xc42' : disk_copy_4_2e_2_checksum,
        'rcpO' : resulting_target_object,
        'Paim' : auto_image_upon_insert,
        'comt' : comment,
        'PCoE' : erase_confirmation,
        'dVer' : driver_version,
        'PDeN' : default_create_name,
        'PBuM' : make_multiple_floppies,
        'rcpT' : copy_type,
        'PDiE' : volume_suffix,
        'Ifmt' : file_format,
        'Pdfm' : default_image_format,
        'ascd' : creation_date,
        'Pejc' : eject_after_auto_image,
        'PZeB' : zeroing,
        'PExR' : exclude_remote_images,
        'PImE' : image_suffix,
        'PVeS' : signature_verification,
        'PSaL' : save_log_file,
        'Xblk' : block_count,
        'PMoA' : leave_image_mounted,
        'Isg#' : segments,
        'Irfk' : resource_fork_size,
        'Icom' : compressed,
        'Xfsi' : file_system,
        'Idfk' : data_fork_size,
        'vers' : version,
        'PSiI' : image_signing,
468 469 470 471 472 473
}

_compdeclarations = {
}

_enumdeclarations = {
474 475 476
        'SvAs' : _Enum_SvAs,
        'UIAc' : _Enum_UIAc,
        'rcpT' : _Enum_rcpT,
477
}