»Core Development>Code coverage>Mac/Demo/applescript/Disk_Copy/Standard_Suite.py

Python code coverage for Mac/Demo/applescript/Disk_Copy/Standard_Suite.py

#countcontent
1n/a"""Suite Standard Suite: Common terms for most applications
2n/aLevel 1, version 1
3n/a
4n/aGenerated from Macintosh HD:Hulpprogramma's:Disk Copy
5n/aAETE/AEUT resource version 1/0, language 0, script 0
6n/a"""
7n/a
8n/aimport aetools
9n/aimport MacOS
10n/a
11n/a_code = 'Core'
12n/a
13n/aclass Standard_Suite_Events:
14n/a
15n/a _argmap_save = {
16n/a '_in' : 'kfil',
17n/a 'using_format' : 'SvAs',
18n/a 'checksum_verification' : 'VChk',
19n/a 'signature_verification' : 'VSig',
20n/a 'image_signing' : 'SImg',
21n/a 'leave_image_mounted' : 'Moun',
22n/a 'percent_free_space' : 'Slop',
23n/a 'logical_blocks' : 'Blks',
24n/a 'zeroing' : 'Zero',
25n/a }
26n/a
27n/a def save(self, _object, _attributes={}, **_arguments):
28n/a """save: Save an object
29n/a Required argument: the source object
30n/a Keyword argument _in: the target object
31n/a Keyword argument using_format: the format for the target
32n/a Keyword argument checksum_verification: Should the checksum be verified before saving?
33n/a Keyword argument signature_verification: Should the DigiSignŽ signature be verified before saving?
34n/a Keyword argument image_signing: Should the image be signed?
35n/a Keyword argument leave_image_mounted: Should the image be mounted after saving?
36n/a Keyword argument percent_free_space: percent free space to reserve (for image folder operation, 0-255%)
37n/a Keyword argument logical_blocks: number of logical blocks in the image (for image folder operation)
38n/a Keyword argument zeroing: Should all the blocks in the image be set to zeros? (for image folder operation)
39n/a Keyword argument _attributes: AppleEvent attribute dictionary
40n/a Returns: the result of the save operation
41n/a """
42n/a _code = 'core'
43n/a _subcode = 'save'
44n/a
45n/a aetools.keysubst(_arguments, self._argmap_save)
46n/a _arguments['----'] = _object
47n/a
48n/a aetools.enumsubst(_arguments, 'kfil', _Enum_obj_)
49n/a aetools.enumsubst(_arguments, 'SvAs', _Enum_SvAs)
50n/a aetools.enumsubst(_arguments, 'VChk', _Enum_bool)
51n/a aetools.enumsubst(_arguments, 'VSig', _Enum_bool)
52n/a aetools.enumsubst(_arguments, 'SImg', _Enum_bool)
53n/a aetools.enumsubst(_arguments, 'Moun', _Enum_bool)
54n/a aetools.enumsubst(_arguments, 'Slop', _Enum_long)
55n/a aetools.enumsubst(_arguments, 'Blks', _Enum_long)
56n/a aetools.enumsubst(_arguments, 'Zero', _Enum_bool)
57n/a
58n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
59n/a _arguments, _attributes)
60n/a if _arguments.has_key('errn'):
61n/a raise aetools.Error, aetools.decodeerror(_arguments)
62n/a # XXXX Optionally decode result
63n/a if _arguments.has_key('----'):
64n/a return _arguments['----']
65n/a
66n/a def do_script(self, _object, _attributes={}, **_arguments):
67n/a """do script: Execute an attached script located in the folder "Scripts"
68n/a Required argument: the script to be executed
69n/a Keyword argument _attributes: AppleEvent attribute dictionary
70n/a """
71n/a _code = 'core'
72n/a _subcode = 'dosc'
73n/a
74n/a if _arguments: raise TypeError, 'No optional args expected'
75n/a _arguments['----'] = _object
76n/a
77n/a
78n/a _reply, _arguments, _attributes = self.send(_code, _subcode,
79n/a _arguments, _attributes)
80n/a if _arguments.has_key('errn'):
81n/a raise aetools.Error, aetools.decodeerror(_arguments)
82n/a # XXXX Optionally decode result
83n/a if _arguments.has_key('----'):
84n/a return _arguments['----']
85n/a
86n/a
87n/aclass application(aetools.ComponentItem):
88n/a """application - The Disk Copy application """
89n/a want = 'capp'
90n/aclass version(aetools.NProperty):
91n/a """version - the version of this application """
92n/a which = 'vers'
93n/a want = 'vers'
94n/aclass name(aetools.NProperty):
95n/a """name - the name of this application """
96n/a which = 'pnam'
97n/a want = 'TEXT'
98n/aclass comment(aetools.NProperty):
99n/a """comment - the comment associated with the application """
100n/a which = 'comt'
101n/a want = 'TEXT'
102n/aclass driver_version(aetools.NProperty):
103n/a """driver version - the version of the disk image driver """
104n/a which = 'dVer'
105n/a want = 'vers'
106n/aclass nonejectable_mode(aetools.NProperty):
107n/a """nonejectable mode - Should mounted images be non-ejectable? """
108n/a which = 'otto'
109n/a want = 'bool'
110n/aclass save_log_file(aetools.NProperty):
111n/a """save log file - Should the log file be saved on disk? """
112n/a which = 'PSaL'
113n/a want = 'bool'
114n/aclass use_speech(aetools.NProperty):
115n/a """use speech - Should Disk Copy use spoken feedback? """
116n/a which = 'PTlk'
117n/a want = 'bool'
118n/aclass smart_Save_As(aetools.NProperty):
119n/a """smart Save As - Should the Save As... dialog box automatically go to the right folder? """
120n/a which = 'PSSP'
121n/a want = 'bool'
122n/aclass checksum_verification(aetools.NProperty):
123n/a """checksum verification - Should image checksums be verified? """
124n/a which = 'PVeC'
125n/a want = 'bool'
126n/aclass signature_verification(aetools.NProperty):
127n/a """signature verification - Should digital signatures be verified? """
128n/a which = 'PVeS'
129n/a want = 'bool'
130n/aclass exclude_DiskScripts(aetools.NProperty):
131n/a """exclude DiskScripts - Should images referenced in DiskScripts/DiskSets be excluded from verification? """
132n/a which = 'PExD'
133n/a want = 'bool'
134n/aclass exclude_remote_images(aetools.NProperty):
135n/a """exclude remote images - Should images that are located on network volumes be excluded from verification? """
136n/a which = 'PExR'
137n/a want = 'bool'
138n/aclass image_signing(aetools.NProperty):
139n/a """image signing - Should images be signed with a digital signature? """
140n/a which = 'PSiI'
141n/a want = 'bool'
142n/aclass leave_image_mounted(aetools.NProperty):
143n/a """leave image mounted - Should images be mounted after they are created? """
144n/a which = 'PMoA'
145n/a want = 'bool'
146n/aclass erase_confirmation(aetools.NProperty):
147n/a """erase confirmation - Should the user be required to confirm commands that erase disks? """
148n/a which = 'PCoE'
149n/a want = 'bool'
150n/aclass zeroing(aetools.NProperty):
151n/a """zeroing - Should all blocks of a new image be set to zero? """
152n/a which = 'PZeB'
153n/a want = 'bool'
154n/aclass default_create_size(aetools.NProperty):
155n/a """default create size - the default size for a new image, in blocks (512 bytes per block) """
156n/a which = 'PDeS'
157n/a want = 'long'
158n/aclass default_create_name(aetools.NProperty):
159n/a """default create name - the default volume name for a new image """
160n/a which = 'PDeN'
161n/a want = 'TEXT'
162n/aclass make_multiple_floppies(aetools.NProperty):
163n/a """make multiple floppies - Should the user be prompted to make multiple floppy disk images at a time? """
164n/a which = 'PBuM'
165n/a want = 'bool'
166n/aclass auto_image_upon_insert(aetools.NProperty):
167n/a """auto image upon insert - Should a newly-inserted disk automatically be processed into an image? """
168n/a which = 'Paim'
169n/a want = 'bool'
170n/aclass eject_after_auto_image(aetools.NProperty):
171n/a """eject after auto image - Should auto-imaged disks be ejected afterwards? """
172n/a which = 'Pejc'
173n/a want = 'bool'
174n/aclass auto_copy_upon_floppy_insert(aetools.NProperty):
175n/a """auto copy upon floppy insert - Instead of auto-imaging, should newly-inserted floppy disks be copied? """
176n/a which = 'Pcpf'
177n/a want = 'bool'
178n/aclass volume_suffix(aetools.NProperty):
179n/a """volume suffix - the default volume name suffix """
180n/a which = 'PDiE'
181n/a want = 'TEXT'
182n/aclass image_suffix(aetools.NProperty):
183n/a """image suffix - the default image name suffix """
184n/a which = 'PImE'
185n/a want = 'TEXT'
186n/aclass default_file_system(aetools.NProperty):
187n/a """default file system - the default file system type for new blank images """
188n/a which = 'Pfsy'
189n/a want = 'Fsys'
190n/aclass default_image_format(aetools.NProperty):
191n/a """default image format - the default image file format """
192n/a which = 'Pdfm'
193n/a want = 'SvAs'
194n/a
195n/aclass disk(aetools.ComponentItem):
196n/a """disk - A mounted volume """
197n/a want = 'Disk'
198n/a
199n/aname = name
200n/a
201n/acomment = comment
202n/aclass locked(aetools.NProperty):
203n/a """locked - Is the disk locked? """
204n/a which = 'islk'
205n/a want = 'bool'
206n/aclass creation_date(aetools.NProperty):
207n/a """creation date - the creation date of disk """
208n/a which = 'ascd'
209n/a want = 'ldt '
210n/aclass modification_date(aetools.NProperty):
211n/a """modification date - the modification date of disk """
212n/a which = 'asmo'
213n/a want = 'ldt '
214n/aclass crc32_checksum(aetools.NProperty):
215n/a """crc32 checksum - the crc-32 checksum of the disk """
216n/a which = 'Xcrc'
217n/a want = 'TEXT'
218n/aclass disk_copy_4_2e_2_checksum(aetools.NProperty):
219n/a """disk copy 4.2 checksum - the Disk Copy 4.2 checksum of the disk """
220n/a which = 'Xc42'
221n/a want = 'TEXT'
222n/aclass block_count(aetools.NProperty):
223n/a """block count - the number of blocks on disk """
224n/a which = 'Xblk'
225n/a want = 'long'
226n/aclass file_system(aetools.NProperty):
227n/a """file system - the file system used on disk """
228n/a which = 'Xfsi'
229n/a want = 'TEXT'
230n/a
231n/aclass folder(aetools.ComponentItem):
232n/a """folder - A folder or directory on a disk """
233n/a want = 'Fold'
234n/a
235n/aname = name
236n/a
237n/acomment = comment
238n/a
239n/acreation_date = creation_date
240n/a
241n/amodification_date = modification_date
242n/a
243n/aclass disk_image(aetools.ComponentItem):
244n/a """disk image - A disk image file """
245n/a want = 'DImg'
246n/a
247n/aname = name
248n/a
249n/acomment = comment
250n/a
251n/alocked = locked
252n/a
253n/acreation_date = creation_date
254n/a
255n/amodification_date = modification_date
256n/aclass file_format(aetools.NProperty):
257n/a """file format - the format of the disk image file """
258n/a which = 'Ifmt'
259n/a want = 'TEXT'
260n/aclass signed(aetools.NProperty):
261n/a """signed - Does the disk image have a DigiSignŽ signature? """
262n/a which = 'Isin'
263n/a want = 'bool'
264n/aclass compressed(aetools.NProperty):
265n/a """compressed - Is the disk image compressed? """
266n/a which = 'Icom'
267n/a want = 'bool'
268n/aclass segmented(aetools.NProperty):
269n/a """segmented - Is the disk image segmented? """
270n/a which = 'Iseg'
271n/a want = 'bool'
272n/aclass segments(aetools.NProperty):
273n/a """segments - a list of references to other segments that make up a complete image """
274n/a which = 'Isg#'
275n/a want = 'fss '
276n/aclass disk_name(aetools.NProperty):
277n/a """disk name - the name of the disk this image represents """
278n/a which = 'Idnm'
279n/a want = 'TEXT'
280n/a
281n/acrc32_checksum = crc32_checksum
282n/a
283n/adisk_copy_4_2e_2_checksum = disk_copy_4_2e_2_checksum
284n/a
285n/ablock_count = block_count
286n/a
287n/afile_system = file_system
288n/aclass data_fork_size(aetools.NProperty):
289n/a """data fork size - the size (in bytes) of the data fork of the disk image """
290n/a which = 'Idfk'
291n/a want = 'long'
292n/aclass resource_fork_size(aetools.NProperty):
293n/a """resource fork size - the size (in bytes) of the resource fork of the disk image """
294n/a which = 'Irfk'
295n/a want = 'long'
296n/a
297n/aclass Save_reply_record(aetools.ComponentItem):
298n/a """Save reply record - Result from the save operation """
299n/a want = 'cpyR'
300n/aclass resulting_target_object(aetools.NProperty):
301n/a """resulting target object - a reference to the target object after it has been saved """
302n/a which = 'rcpO'
303n/a want = 'obj '
304n/aclass copy_type(aetools.NProperty):
305n/a """copy type - the way in which the target object was saved """
306n/a which = 'rcpT'
307n/a want = 'rcpT'
308n/aapplication._propdict = {
309n/a 'version' : version,
310n/a 'name' : name,
311n/a 'comment' : comment,
312n/a 'driver_version' : driver_version,
313n/a 'nonejectable_mode' : nonejectable_mode,
314n/a 'save_log_file' : save_log_file,
315n/a 'use_speech' : use_speech,
316n/a 'smart_Save_As' : smart_Save_As,
317n/a 'checksum_verification' : checksum_verification,
318n/a 'signature_verification' : signature_verification,
319n/a 'exclude_DiskScripts' : exclude_DiskScripts,
320n/a 'exclude_remote_images' : exclude_remote_images,
321n/a 'image_signing' : image_signing,
322n/a 'leave_image_mounted' : leave_image_mounted,
323n/a 'erase_confirmation' : erase_confirmation,
324n/a 'zeroing' : zeroing,
325n/a 'default_create_size' : default_create_size,
326n/a 'default_create_name' : default_create_name,
327n/a 'make_multiple_floppies' : make_multiple_floppies,
328n/a 'auto_image_upon_insert' : auto_image_upon_insert,
329n/a 'eject_after_auto_image' : eject_after_auto_image,
330n/a 'auto_copy_upon_floppy_insert' : auto_copy_upon_floppy_insert,
331n/a 'volume_suffix' : volume_suffix,
332n/a 'image_suffix' : image_suffix,
333n/a 'default_file_system' : default_file_system,
334n/a 'default_image_format' : default_image_format,
335n/a}
336n/aapplication._elemdict = {
337n/a}
338n/adisk._propdict = {
339n/a 'name' : name,
340n/a 'comment' : comment,
341n/a 'locked' : locked,
342n/a 'creation_date' : creation_date,
343n/a 'modification_date' : modification_date,
344n/a 'crc32_checksum' : crc32_checksum,
345n/a 'disk_copy_4_2e_2_checksum' : disk_copy_4_2e_2_checksum,
346n/a 'block_count' : block_count,
347n/a 'file_system' : file_system,
348n/a}
349n/adisk._elemdict = {
350n/a}
351n/afolder._propdict = {
352n/a 'name' : name,
353n/a 'comment' : comment,
354n/a 'creation_date' : creation_date,
355n/a 'modification_date' : modification_date,
356n/a}
357n/afolder._elemdict = {
358n/a}
359n/adisk_image._propdict = {
360n/a 'name' : name,
361n/a 'comment' : comment,
362n/a 'locked' : locked,
363n/a 'creation_date' : creation_date,
364n/a 'modification_date' : modification_date,
365n/a 'file_format' : file_format,
366n/a 'signed' : signed,
367n/a 'compressed' : compressed,
368n/a 'segmented' : segmented,
369n/a 'segments' : segments,
370n/a 'disk_name' : disk_name,
371n/a 'crc32_checksum' : crc32_checksum,
372n/a 'disk_copy_4_2e_2_checksum' : disk_copy_4_2e_2_checksum,
373n/a 'block_count' : block_count,
374n/a 'file_system' : file_system,
375n/a 'data_fork_size' : data_fork_size,
376n/a 'resource_fork_size' : resource_fork_size,
377n/a}
378n/adisk_image._elemdict = {
379n/a}
380n/aSave_reply_record._propdict = {
381n/a 'resulting_target_object' : resulting_target_object,
382n/a 'copy_type' : copy_type,
383n/a}
384n/aSave_reply_record._elemdict = {
385n/a}
386n/a_Enum_UIAc = {
387n/a 'never_interact' : 'eNvr', # DonÕt allow any interaction at all
388n/a 'interact_with_self' : 'eInS', # Only allow interaction from internal events
389n/a 'interact_with_local' : 'eInL', # Allow interaction from any event originating on this machine
390n/a 'interact_with_all' : 'eInA', # Allow interaction from network events
391n/a}
392n/a
393n/a_Enum_SvAs = {
394n/a 'NDIF_RW' : 'RdWr', # read/write NDIF disk image
395n/a 'NDIF_RO' : 'Rdxx', # read-only NDIF disk image
396n/a 'NDIF_Compressed' : 'ROCo', # compressed NDIF disk image
397n/a 'Disk_Copy_4_2e_2' : 'DC42', # Disk Copy 4.2 disk image
398n/a}
399n/a
400n/a_Enum_rcpT = {
401n/a 'block_disk_copy' : 'cpBl', # block-by-block disk-level copy
402n/a 'files_and_file_ID_copy' : 'cpID', # all files including desktop databases and file IDÕs
403n/a 'files_and_desktop_info' : 'cpDT', # all files and most desktop information
404n/a 'files_only' : 'cpFI', # all files but no desktop information
405n/a 'disk_image_conversion' : 'cpCV', # disk image format conversion
406n/a 'disk_image_creation' : 'cpCR', # disk image creation
407n/a}
408n/a
409n/a_Enum_long = None # XXXX enum long not found!!
410n/a_Enum_bool = None # XXXX enum bool not found!!
411n/a_Enum_obj_ = None # XXXX enum obj not found!!
412n/a
413n/a#
414n/a# Indices of types declared in this module
415n/a#
416n/a_classdeclarations = {
417n/a 'DImg' : disk_image,
418n/a 'capp' : application,
419n/a 'Disk' : disk,
420n/a 'Fold' : folder,
421n/a 'cpyR' : Save_reply_record,
422n/a}
423n/a
424n/a_propdeclarations = {
425n/a 'Xcrc' : crc32_checksum,
426n/a 'PDeS' : default_create_size,
427n/a 'Idnm' : disk_name,
428n/a 'PSSP' : smart_Save_As,
429n/a 'Pcpf' : auto_copy_upon_floppy_insert,
430n/a 'pnam' : name,
431n/a 'Isin' : signed,
432n/a 'otto' : nonejectable_mode,
433n/a 'PExD' : exclude_DiskScripts,
434n/a 'Iseg' : segmented,
435n/a 'islk' : locked,
436n/a 'asmo' : modification_date,
437n/a 'PTlk' : use_speech,
438n/a 'Pfsy' : default_file_system,
439n/a 'PVeC' : checksum_verification,
440n/a 'Xc42' : disk_copy_4_2e_2_checksum,
441n/a 'rcpO' : resulting_target_object,
442n/a 'Paim' : auto_image_upon_insert,
443n/a 'comt' : comment,
444n/a 'PCoE' : erase_confirmation,
445n/a 'dVer' : driver_version,
446n/a 'PDeN' : default_create_name,
447n/a 'PBuM' : make_multiple_floppies,
448n/a 'rcpT' : copy_type,
449n/a 'PDiE' : volume_suffix,
450n/a 'Ifmt' : file_format,
451n/a 'Pdfm' : default_image_format,
452n/a 'ascd' : creation_date,
453n/a 'Pejc' : eject_after_auto_image,
454n/a 'PZeB' : zeroing,
455n/a 'PExR' : exclude_remote_images,
456n/a 'PImE' : image_suffix,
457n/a 'PVeS' : signature_verification,
458n/a 'PSaL' : save_log_file,
459n/a 'Xblk' : block_count,
460n/a 'PMoA' : leave_image_mounted,
461n/a 'Isg#' : segments,
462n/a 'Irfk' : resource_fork_size,
463n/a 'Icom' : compressed,
464n/a 'Xfsi' : file_system,
465n/a 'Idfk' : data_fork_size,
466n/a 'vers' : version,
467n/a 'PSiI' : image_signing,
468n/a}
469n/a
470n/a_compdeclarations = {
471n/a}
472n/a
473n/a_enumdeclarations = {
474n/a 'SvAs' : _Enum_SvAs,
475n/a 'UIAc' : _Enum_UIAc,
476n/a 'rcpT' : _Enum_rcpT,
477n/a}