added volume plugin icons

fixed small bugs in error output
fixed some subprocess.communicate mistakes
fixed display bug in partition plugin
This commit is contained in:
lars 2006-11-03 14:27:55 +00:00
parent 2d7b34afaa
commit 5846c3b0f8
15 changed files with 16 additions and 16 deletions

View File

@ -64,6 +64,6 @@ class date(CryptoBoxPlugin.CryptoBoxPlugin):
"plugin",
os.path.join(self.pluginDir, "root_action.py"),
date])
proc.communicate()
proc.wait()
return proc.returncode == 0

View File

@ -31,6 +31,6 @@ if __name__ == "__main__":
shell = False,
stdout = subprocess.PIPE,
args = [DATE_BIN, args[0]])
proc.communicate()
proc.wait()
sys.exit(proc.returncode)

View File

@ -11,7 +11,7 @@
<?cs else ?>
<?cs # we use "loop" instead of "each" to keep the order of the disks ?>
<?cs loop: index = #0, subcount(Data.Disks)-1, #1 ?>
<?cs call:show_volume(index) ?>
<?cs call:show_volume(Data.Disks[index]) ?>
<?cs /loop ?>
<?cs /if ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -84,7 +84,7 @@ class network(CryptoBoxPlugin.CryptoBoxPlugin):
args = [
root_action_plug.IFCONFIG_BIN,
root_action_plug.IFACE])
(output, error) = proc.communicate()
proc.wait()
if proc.returncode != 0: return (0,0,0,0)
## this regex matches the four numbers of the IP
match = re.search(u'inet [\w]+:(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\s',output)
@ -110,7 +110,7 @@ class network(CryptoBoxPlugin.CryptoBoxPlugin):
"plugin",
os.path.join(self.pluginDir, "root_action.py"),
ip])
proc.communicate()
proc.wait()
if proc.returncode != 0:
self.cbox.log.warn("failed to change IP address: %s" % ip)
self.cbox.log.warn("error output: %s" % str(proc.stderr.read()))

View File

@ -36,6 +36,6 @@ if __name__ == "__main__":
proc = subprocess.Popen(
shell = False,
args = [IFCONFIG_BIN, IFACE, args[0]])
proc.communicate()
proc.wait()
sys.exit(proc.returncode)

View File

@ -21,7 +21,7 @@ def __partitionDevice(device):
SFDISK_BIN,
"-uM",
device])
proc.communicate()
proc.wait()
return proc.returncode == 0
@ -38,7 +38,7 @@ def __formatPartition(device, type):
MKFS_BIN,
"-t", type,
device])
proc.communicate()
proc.wait()
## TODO: very ugly way of communication: it assumes, that failures are fast - success is slow
if proc.returncode == 0:
time.sleep(1)
@ -57,7 +57,7 @@ def __labelPartition(device, label):
LABEL_BIN,
device,
label])
proc.communicate()
proc.wait()
return proc.returncode == 0

View File

@ -8,7 +8,7 @@
<div align="center">
<table class="partition">
<?cs if:Data.Plugins.partition.availSize > 0 ?>
<?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>

View File

@ -16,7 +16,7 @@ def call_prog(progy):
proc = subprocess.Popen(
shell = False,
args = [progy])
proc.communicate()
proc.wait()
return proc.returncode == 0

View File

@ -46,6 +46,6 @@ class shutdown(CryptoBoxPlugin.CryptoBoxPlugin):
"plugin",
os.path.join(self.pluginDir, "root_action.py"),
action])
proc.communicate()
proc.wait()
return proc.returncode == 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,5 +1,5 @@
Name = Mount and umount volumes
Link = Main
Link = Activation
Title {

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -37,7 +37,7 @@ class volume_mount(CryptoBoxPlugin.CryptoBoxPlugin):
def __doMountPlain(self):
if self.container.isMounted():
self.hdf["Data.Warning"] = "Plugins.volume_mount.IsAlreadyMounted"
self.cbox.log.info("the device (%s) is already mounted" % device)
self.cbox.log.info("the device (%s) is already mounted" % self.device)
return "volume_status"
if self.container.getType() != self.container.Types["plain"]:
## not a plain container - fail silently
@ -61,11 +61,11 @@ class volume_mount(CryptoBoxPlugin.CryptoBoxPlugin):
def __doMountLuks(self, pw):
if self.container.isMounted():
self.hdf["Data.Warning"] = "Plugins.volume_mount.IsAlreadyMounted"
self.cbox.log.info("the device (%s) is already mounted" % device)
self.cbox.log.info("the device (%s) is already mounted" % self.device)
return "volume_status"
if not pw:
self.dataset["Data.Warning"] = "EmptyPassword"
self.log.info("no password was supplied for mounting of device: '%s'" % device)
self.log.info("no password was supplied for mounting of device: '%s'" % self.device)
return "volume_status"
if self.container.getType() != self.container.Types["luks"]:
## not a luks container - fail silently

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB