fixed a nasty typo

adapted to new volume name management
This commit is contained in:
lars 2006-11-14 12:32:08 +00:00
parent 7e5980a573
commit 23bb313594
2 changed files with 11 additions and 9 deletions

View file

@ -41,7 +41,7 @@ class partition(CryptoBoxPlugin.CryptoBoxPlugin):
pass
## no (or invalid) device was supplied
if not self.device:
step == "select_device"
step = "select_device"
if step == "add_partition":
return self.__actionAddPartition(args)
elif step == "del_partition":
@ -230,7 +230,6 @@ class partition(CryptoBoxPlugin.CryptoBoxPlugin):
self.hdf[self.hdf_prefix + "Types.%s" % t] = t
## store the currently existing partitions of the choosen block device
current_containers = [ e for e in self.cbox.getContainerList() if CryptoBoxTools.isPartOfBlockDevice(self.device, e.getDevice()) ]
## additionally store the uuids (to be removed after partitioning)
for (index, t) in enumerate(current_containers):
self.hdf[self.hdf_prefix + "ExistingContainers.%d.name" % index] = t.getName()
self.hdf[self.hdf_prefix + "ExistingContainers.%d.size" % index] = CryptoBoxTools.getBlockDeviceSizeHumanly(t.getDevice())
@ -373,7 +372,8 @@ class partition(CryptoBoxPlugin.CryptoBoxPlugin):
def __formatOnePartition(self, dev_name, type):
## first: retrieve UUID - it can be removed from the database afterwards
prev_uuid = [self.cbox.getUUIDForName(e.getName()) for e in self.cbox.getContainerList() if e.getDevice() == dev_name ]
volDB = self.cbox.prefs.volumesDB
prev_name = [e.getName() for e in self.cbox.getContainerList() if e.getDevice() == dev_name]
## call "mkfs"
proc = subprocess.Popen(
shell = False,
@ -390,9 +390,9 @@ class partition(CryptoBoxPlugin.CryptoBoxPlugin):
self.cbox.log.warn("failed to create filesystem on %s: %s" % (dev_name, error))
return False
else:
## remove unused uuid
if prev_uuid:
self.cbox.removeUUID(prev_uuid[0])
## remove unused volume entry
if prev_name:
self.cbox.prefs.volumesDB[prev_name[0]]
return True

View file

@ -2,19 +2,19 @@
<style type="text/css"><?cs include:Data.Plugins.partition.StyleSheetFile ?></style>
<?cs # show nothing if the harddisk is not partitionable (e.g. still active) ?>
<?cs if:(Data.Plugins.partition.availSize > 0) || (subcount(Data.Plugins.partition.Parts) > 0) ?>
<h1><?cs var:html_escape(Lang.Plugins.partition.Title.Partition) ?></h1>
<div align="center">
<table class="partition">
<?cs if:(Data.Plugins.partition.availSize > 0) || (subcount(Data.Plugins.partition.Parts) > 0) ?>
<?cs # no table header if the harddisk is not partitionable (e.g. still active) ?>
<tr>
<th><?cs var:html_escape(Lang.Plugins.partition.Text.PartNum) ?></th>
<th><?cs var:html_escape(Lang.Plugins.partition.Text.Size) ?></th>
<th><?cs var:html_escape(Lang.Plugins.partition.Text.PartType) ?></th>
<th></th>
</tr>
<?cs /if ?>
<?cs loop: x = #0, subcount(Data.Plugins.partition.Parts)-1, #1 ?>
<tr>
@ -74,3 +74,5 @@
</ul></p>
<?cs /if ?>
<?cs /if ?>