Home | Trees | Index | Help |
|
---|
Package CedarBackup2 :: Module image :: Class IsoImage |
|
object
--+
|
IsoImage
This object represents an ISO 9660 filesystem image. It is
implemented in terms of the mkisofs
program, which has
been ported to many operating systems and platforms. A "sensible
subset" of the mkisofs
functionality is made
available through the public interface, allowing callers to set a
variety of basic options such as publisher id, application id, etc. as
well as specify exactly which files and directories they want included
in their image.
-r
option to mkisofs
) because Rock
Ridge discs are generally more useful on UN*X filesystems than standard
ISO 9660 images. However, callers can fall back to the default
mkisofs
functionality by setting the
useRockRidge
instance variable to False
.
Note, however, that this option is not well-tested.
Although this class is implemented in terms of the
mkisofs
program, its standard "image contents"
semantics are slightly different than the original mkisofs
semantics. The difference is that files and directories are added to
the image with some additional information about their source directory
kept intact.
As an example, suppose you add the file /etc/profile
to
your image and you do not configure a graft point. The file
/profile
will be created in the image. The behavior for
directories is similar. For instance, suppose that you add
/etc/X11
to the image and do not configure a graft point.
In this case, the directory /X11
will be created in the
image, even if the original /etc/X11
directory is empty.
This behavior differs from the standard mkisofs
behavior!
If a graft point is configured, it will be used to modify the point
at which a file or directory is added into an image. Using the examples
from above, let's assume you set a graft point of base
when adding /etc/profile
and /etc/X11
to your
image. In this case, the file /base/profile
and the
directory /base/X11
would be added to the image.
mkisofs
behavior. However, to be fair, it is not quite as
flexible, and some users might not like it. For this reason, the
contentsOnly
parameter to the addEntry
method can be used to revert to
the original behavior if desired.
Method Summary | |
---|---|
Initializes an empty ISO image object. | |
Adds an individual file or directory into the ISO image. | |
Returns the estimated size (in bytes) of the ISO image. | |
Returns the estimated size (in bytes) for the passed-in entries dictionary. | |
Writes this image to disk using the image path. | |
Uses an entries dictionary to build a list of directory locations for use by mkisofs . (Static method)
| |
Builds a list of general arguments to be passed to a mkisofs command. | |
Builds a list of arguments to be passed to a mkisofs
command. | |
Builds a list of arguments to be passed to a mkisofs
command. | |
Property target used to get the application id. | |
Property target used to get the biblio file. | |
Property target used to get the boundaries value. | |
Property target used to get the device value. | |
Property target used to get the graft point. | |
Property target used to get the preparer id. | |
Property target used to get the publisher id. | |
Property target used to get the use RockRidge flag. | |
Property target used to get the volume id. | |
Property target used to set the application id. | |
Property target used to set the biblio file. | |
Property target used to set the boundaries tuple. | |
Property target used to set the device value. | |
Property target used to set the graft point. | |
Property target used to set the preparer id. | |
Property target used to set the publisher id. | |
Property target used to set the use RockRidge flag. | |
Property target used to set the volume id. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Property Summary | |
---|---|
device : Device that image will be written to (device path or SCSI id). | |
boundaries : Session boundaries as required by mkisofs . | |
graftPoint : Default image-wide graft point (see addEntry for details). | |
useRockRidge : Indicates whether to use RockRidge (default is True ). | |
applicationId : Optionally specifies the ISO header application id value. | |
biblioFile : Optionally specifies the ISO bibliographic file name. | |
publisherId : Optionally specifies the ISO header publisher id value. | |
preparerId : Optionally specifies the ISO header preparer id value. | |
volumeId : Optionally specifies the ISO header volume id value. |
Instance Method Details |
---|
__init__(self,
device=None,
boundaries=None,
graftPoint=None)
|
addEntry(self, path, graftPoint=None, override=False, contentsOnly=False)Adds an individual file or directory into the ISO image. The path must exist and must be a file or a directory. By default,
the entry will be placed into the image at the root directory, but this
behavior can be overridden using the contentsOnly behavior to revert to the
"original" mkisofs behavior for adding
directories, which is to add only the items within the directory, and
not the directory itself.
|
getEstimatedSize(self)Returns the estimated size (in bytes) of the ISO image. This is implemented via the-print-size option to
mkisofs , so it might take a bit of time to execute.
However, the result is as accurate as we can get, since it takes into
account all of the ISO overhead, the true cost of directories in the
structure, etc, etc.
|
_getEstimatedSize(self, entries)Returns the estimated size (in bytes) for the passed-in entries dictionary.
|
writeImage(self, imagePath)Writes this image to disk using the image path.
|
_buildGeneralArgs(self)Builds a list of general arguments to be passed to a
applicationId , etc.)
are filled into the list of arguments if they are set. By default, we
will build a RockRidge disc. If you decide to change this, think hard
about whether you know what you're doing. This option is not
well-tested.
|
_buildSizeArgs(self, entries)Builds a list of arguments to be passed to a The various instance variables (
|
_buildWriteArgs(self, entries, imagePath)Builds a list of arguments to be passed to a The various instance variables (
|
_getApplicationId(self)Property target used to get the application id. |
_getBiblioFile(self)Property target used to get the biblio file. |
_getBoundaries(self)Property target used to get the boundaries value. |
_getDevice(self)Property target used to get the device value. |
_getGraftPoint(self)Property target used to get the graft point. |
_getPreparerId(self)Property target used to get the preparer id. |
_getPublisherId(self)Property target used to get the publisher id. |
_getUseRockRidge(self)Property target used to get the use RockRidge flag. |
_getVolumeId(self)Property target used to get the volume id. |
_setApplicationId(self, value)Property target used to set the application id. The value must be a non-empty string if it is notNone .
|
_setBiblioFile(self, value)Property target used to set the biblio file. The value must be a non-empty string if it is notNone .
|
_setBoundaries(self, value)Property target used to set the boundaries tuple. If notNone , the value must be a tuple of two integers.
|
_setDevice(self, value)Property target used to set the device value. If notNone , the value can be either an absolute path or a SCSI
id.
|
_setGraftPoint(self, value)Property target used to set the graft point. The value must be a non-empty string if it is notNone .
|
_setPreparerId(self, value)Property target used to set the preparer id. The value must be a non-empty string if it is notNone .
|
_setPublisherId(self, value)Property target used to set the publisher id. The value must be a non-empty string if it is notNone .
|
_setUseRockRidge(self, value)Property target used to set the use RockRidge flag. No validations, but we normalize the value toTrue or
False .
|
_setVolumeId(self, value)Property target used to set the volume id. The value must be a non-empty string if it is notNone .
|
Static Method Details |
---|
_buildDirEntries(entries)Uses an entries dictionary to build a list of directory locations
for use by mkisofs . Each entry is either raw (if no graft point was
configured) or in graft-point form as described above (if a graft point
was configured). The dictionary keys are the path names, and the values
are the graft points, if any.
|
Property Details |
---|
deviceDevice that image will be written to (device path or SCSI id).
|
boundariesSession boundaries as required bymkisofs .
|
graftPointDefault image-wide graft point (seeaddEntry for details).
|
useRockRidgeIndicates whether to use RockRidge (default isTrue ).
|
applicationIdOptionally specifies the ISO header application id value.
|
biblioFileOptionally specifies the ISO bibliographic file name.
|
publisherIdOptionally specifies the ISO header publisher id value.
|
preparerIdOptionally specifies the ISO header preparer id value.
|
volumeIdOptionally specifies the ISO header volume id value.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Sep 4 13:49:35 2006 | http://epydoc.sf.net |