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

View File

@ -2,19 +2,19 @@
<style type="text/css"><?cs include:Data.Plugins.partition.StyleSheetFile ?></style> <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> <h1><?cs var:html_escape(Lang.Plugins.partition.Title.Partition) ?></h1>
<div align="center"> <div align="center">
<table class="partition"> <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> <tr>
<th><?cs var:html_escape(Lang.Plugins.partition.Text.PartNum) ?></th> <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.Size) ?></th>
<th><?cs var:html_escape(Lang.Plugins.partition.Text.PartType) ?></th> <th><?cs var:html_escape(Lang.Plugins.partition.Text.PartType) ?></th>
<th></th> <th></th>
</tr> </tr>
<?cs /if ?>
<?cs loop: x = #0, subcount(Data.Plugins.partition.Parts)-1, #1 ?> <?cs loop: x = #0, subcount(Data.Plugins.partition.Parts)-1, #1 ?>
<tr> <tr>
@ -74,3 +74,5 @@
</ul></p> </ul></p>
<?cs /if ?> <?cs /if ?>
<?cs /if ?>