Package CedarBackup2 :: Module writer
[show private | hide private]
[frames | no frames]

Module CedarBackup2.writer

Provides image writer-related objects.

Author: Kenneth J. Pronovici <pronovic@ieee.org>

Classes
MediaDefinition Class encapsulating information about media definitions.
MediaCapacity Class encapsulating information about media capacity.
CdWriter Class representing a device that knows how to write CD media.

Function Summary
  validateScsiId(scsiId)
Validates a SCSI id string.
  validateDriveSpeed(driveSpeed)
Validates a drive speed value.
  _validateDevice(device, unittest)
Validates configured device.

Variable Summary
int MEDIA_CDRW_74: Constant representing 74-minute CD-RW media.
int MEDIA_CDR_74: Constant representing 74-minute CD-R media.
int MEDIA_CDRW_80: Constant representing 80-minute CD-RW media.
int MEDIA_CDR_80: Constant representing 80-minute CD-R media.
list CDRECORD_COMMAND = ['cdrecord']
list EJECT_COMMAND = ['eject']
Logger logger = <logging.Logger instance at 0x40363dcc>

Function Details

validateScsiId(scsiId)

Validates a SCSI id string. SCSI id must be a string in the form [<method>:]scsibus,target,lun. For Mac OS X (Darwin), we also accept the form IO.*Services[/N].
Parameters:
scsiId - SCSI id for the device.
Returns:
SCSI id as a string, suitable for assignment to CdWriter.scsiId.
Raises:
ValueError - If the SCSI id string is invalid.

Note: For consistency, if None is passed in, None will be returned.

validateDriveSpeed(driveSpeed)

Validates a drive speed value. Drive speed must be an integer which is >= 1.
Parameters:
driveSpeed - Speed at which the drive writes.
Returns:
Drive speed as an integer, suitable for assignment to CdWriter.driveSpeed.
Raises:
ValueError - If the drive speed value is invalid.

Note: For consistency, if None is passed in, None will be returned.

_validateDevice(device, unittest=False)

Validates configured device. The device must be an absolute path, must exist, and must be writable. The unittest flag turns off validation of the device on disk.
Parameters:
device - Filesystem device associated with this writer.
unittest - Indicates whether we're unit testing.
Returns:
Device as a string, suitable for assignment to CdWriter.device.
Raises:
ValueError - If the device value is invalid.
ValueError - If some path cannot be encoded properly.

Variable Details

MEDIA_CDRW_74

Constant representing 74-minute CD-RW media.
Type:
int
Value:
1                                                                     

MEDIA_CDR_74

Constant representing 74-minute CD-R media.
Type:
int
Value:
2                                                                     

MEDIA_CDRW_80

Constant representing 80-minute CD-RW media.
Type:
int
Value:
3                                                                     

MEDIA_CDR_80

Constant representing 80-minute CD-R media.
Type:
int
Value:
4                                                                     

CDRECORD_COMMAND

Type:
list
Value:
['cdrecord']                                                           

EJECT_COMMAND

Type:
list
Value:
['eject']                                                              

logger

Type:
Logger
Value:
<logging.Logger instance at 0x40363dcc>                                

Generated by Epydoc 2.1 on Mon Dec 18 22:53:32 2006 http://epydoc.sf.net