added some basic unittests
changed warning/success message system to a new style unified design of "hints" in form interfaces fixed small bugs in "network" and "partition" plugin interfaces "partition" and "disks" plugins: show blockdevice size during device selection german translation for "disks" plugin added
This commit is contained in:
parent
29d2e442f2
commit
c35e204a7b
34 changed files with 197 additions and 57 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
<h1><?cs var:html_escape(Lang.Plugins.date.Title.ConfigDate) ?></h1>
|
<h1><?cs var:html_escape(Lang.Plugins.date.Title.ConfigDate) ?></h1>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<?cs call:print_form_header("set_date", "plugins/date") ?>
|
<?cs call:print_form_header("set_date", "plugins/date") ?>
|
||||||
|
|
||||||
<p><label for="date"><?cs var:html_escape(Lang.Plugins.date.Text.Date) ?>: </label><br/>
|
<p><label for="date"><?cs var:html_escape(Lang.Plugins.date.Text.Date) ?>: </label><br/>
|
||||||
|
|
|
@ -2,10 +2,12 @@
|
||||||
|
|
||||||
<h1><?cs var:html_escape(Lang.Plugins.disks.Title.Disks) ?></h1>
|
<h1><?cs var:html_escape(Lang.Plugins.disks.Title.Disks) ?></h1>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<?cs # TODO: add no-disks-available warning ?>
|
<?cs # TODO: add no-disks-available warning ?>
|
||||||
|
|
||||||
<?cs if:subcount(Data.Disks) == 0 ?>
|
<?cs if:subcount(Data.Disks) == 0 ?>
|
||||||
NO DISKS
|
<?cs call:hint(Lang.Plugins.disks.Text.NoDisksAvailable) ?>
|
||||||
<?cs else ?>
|
<?cs else ?>
|
||||||
<?cs # we use "loop" instead of "each" to keep the order of the disks ?>
|
<?cs # we use "loop" instead of "each" to keep the order of the disks ?>
|
||||||
<?cs loop: index = #0, subcount(Data.Disks)-1, #1 ?>
|
<?cs loop: index = #0, subcount(Data.Disks)-1, #1 ?>
|
||||||
|
|
6
pythonrewrite/plugins/disks/lang/de.hdf
Normal file
6
pythonrewrite/plugins/disks/lang/de.hdf
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
Name = Datenträger-Übersicht
|
||||||
|
Link = Datenträger
|
||||||
|
|
||||||
|
Title.Disks = Verfügbare Datenträger
|
||||||
|
|
||||||
|
Text.NoDisksAvailable = Es sind keine Datenträger verfügbar!
|
|
@ -3,3 +3,4 @@ Link = Disks
|
||||||
|
|
||||||
Title.Disks = Available disks
|
Title.Disks = Available disks
|
||||||
|
|
||||||
|
Text.NoDisksAvailable = No available disks were found!
|
||||||
|
|
9
pythonrewrite/plugins/disks/unittests.py
Normal file
9
pythonrewrite/plugins/disks/unittests.py
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import WebInterfaceTestClass
|
||||||
|
|
||||||
|
class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
|
||||||
|
|
||||||
|
def test_read_form(self):
|
||||||
|
'''display all devices'''
|
||||||
|
self.cmd.go(self.URL + "plugins/disks?weblang=en")
|
||||||
|
self.cmd.find("Disks")
|
||||||
|
|
10
pythonrewrite/plugins/format_fs/unittests.py
Normal file
10
pythonrewrite/plugins/format_fs/unittests.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import WebInterfaceTestClass
|
||||||
|
|
||||||
|
class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
|
||||||
|
|
||||||
|
def test_read_form(self):
|
||||||
|
url = self.URL + "plugins/format_fs?weblang=en&device=%2Fdev%2Floop1"
|
||||||
|
self.register_auth(url)
|
||||||
|
self.cmd.go(url)
|
||||||
|
self.cmd.find('Initializing filesystem')
|
||||||
|
|
|
@ -4,28 +4,29 @@
|
||||||
|
|
||||||
<h2><?cs var:html_escape(Lang.Plugins.format_fs.Title.Format) ?></h2>
|
<h2><?cs var:html_escape(Lang.Plugins.format_fs.Title.Format) ?></h2>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<?cs if:Data.CurrentDisk.active ?>
|
<?cs if:Data.CurrentDisk.active ?>
|
||||||
<div class="unavailable_action">
|
<?cs call:hint(Lang.Plugins.format_fs.Text.UnmountBeforeInit) ?>
|
||||||
<?cs var:html_escape(Lang.Plugins.format_fs.Text.UnmountBeforeInit) ?>
|
|
||||||
</div>
|
|
||||||
<?cs else ?>
|
<?cs else ?>
|
||||||
|
|
||||||
<?cs call:print_form_header("set_type", "plugins/format_fs") ?>
|
<?cs call:print_form_header("set_type", "plugins/format_fs") ?>
|
||||||
|
|
||||||
|
<?cs call:hint(Lang.Plugins.format_fs.Text.FormatWarning) ?>
|
||||||
|
|
||||||
<p><label for="fs_type"><?cs var:html_escape(Lang.Plugins.format_fs.Text.FSType)
|
<p><label for="fs_type"><?cs var:html_escape(Lang.Plugins.format_fs.Text.FSType)
|
||||||
?>: </label><select name="fs_type" id="fs_type" size="0" ?>
|
?>: </label><select name="fs_type" id="fs_type" size="0">
|
||||||
<?cs each:x = Data.Plugins.format_fs.fs_types ?>
|
<?cs each:x = Data.Plugins.format_fs.fs_types ?>
|
||||||
<option <?cs if:x == "windows" ?>selected="selected"<?cs /if ?>><?cs var:html_escape(x) ?></option><?cs /each ?>
|
<option <?cs if:x == "windows" ?>selected="selected"<?cs /if ?>><?cs var:html_escape(x) ?></option><?cs /each ?>
|
||||||
</select></p>
|
</select></p>
|
||||||
|
|
||||||
<p><label for="container_type"><?cs var:html_escape(Lang.Plugins.format_fs.Text.IsEncrypted)
|
<p><label for="container_type"><?cs var:html_escape(Lang.Plugins.format_fs.Text.IsEncrypted)
|
||||||
?>: <select name="container_type" id="container_type">
|
?>: </label><select name="container_type" id="container_type">
|
||||||
<option value="luks" <?cs if:Data.Plugins.format_fs.container_type != "plain" ?>selected="selected"<?cs /if ?>><?cs var:html_escape(Lang.Plugins.format_fs.Text.Yes) ?></option> -->
|
<option value="luks" <?cs if:Data.Plugins.format_fs.container_type != "plain" ?>selected="selected"<?cs /if ?>><?cs var:html_escape(Lang.Plugins.format_fs.Text.Yes) ?></option>
|
||||||
<option value="plain" <?cs if:Data.Plugins.format_fs.container_type == "plain" ?>selected="selected"<?cs /if ?>><?cs var:html_escape(Lang.Plugins.format_fs.Text.No) ?></option>
|
<option value="plain" <?cs if:Data.Plugins.format_fs.container_type == "plain" ?>selected="selected"<?cs /if ?>><?cs var:html_escape(Lang.Plugins.format_fs.Text.No) ?></option>
|
||||||
</select></p>
|
</select></p>
|
||||||
|
|
||||||
<p class="note"><?cs var:html_escape(Lang.Plugins.format_fs.Text.FormatWarning) ?></p>
|
<p><input type="checkbox" name="confirm" value="1" id="confirm" /><label for="confirm"><?cs var:html_escape(Lang.Plugins.format_fs.Text.Confirm) ?></label></p>
|
||||||
<p><input type="checkbox" name="confirm" value="1" id="confirm"><label for="confirm"><?cs var:html_escape(Lang.Plugins.format_fs.Text.Confirm) ?><p/>
|
|
||||||
|
|
||||||
<input type="hidden" name="device" value="<?cs var:Data.CurrentDisk.device ?>" />
|
<input type="hidden" name="device" value="<?cs var:Data.CurrentDisk.device ?>" />
|
||||||
<input type="hidden" name="store" value="step1" />
|
<input type="hidden" name="store" value="step1" />
|
||||||
|
|
|
@ -4,15 +4,15 @@
|
||||||
|
|
||||||
<h2><?cs var:html_escape(Lang.Plugins.format_fs.Title.Format) ?></h2>
|
<h2><?cs var:html_escape(Lang.Plugins.format_fs.Title.Format) ?></h2>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<?cs if:Data.CurrentDisk.active ?>
|
<?cs if:Data.CurrentDisk.active ?>
|
||||||
<div class="unavailable_action">
|
<?cs call:hint(Lang.Plugins.format_fs.Text.UnmountBeforeInit) ?>
|
||||||
<?cs var:html_escape(Lang.Plugins.format_fs.Text.UnmountBeforeInit) ?>
|
|
||||||
</div>
|
|
||||||
<?cs else ?>
|
<?cs else ?>
|
||||||
|
|
||||||
<?cs call:print_form_header("set_luks", "plugins/format_fs") ?>
|
<?cs call:print_form_header("set_luks", "plugins/format_fs") ?>
|
||||||
|
|
||||||
<p class="note"><?cs var:html_escape(Lang.Plugins.format_fs.Text.FormatWarning) ?></p>
|
<?cs call:hint(Lang.Plugins.format_fs.Text.FormatWarning) ?>
|
||||||
|
|
||||||
<p><?cs var:html_escape(Lang.Plugins.format_fs.Text.FSType) ?>: <?cs var:html_escape(Data.Plugins.format_fs.fs_type) ?></p>
|
<p><?cs var:html_escape(Lang.Plugins.format_fs.Text.FSType) ?>: <?cs var:html_escape(Data.Plugins.format_fs.fs_type) ?></p>
|
||||||
<p><?cs var:html_escape(Lang.Plugins.format_fs.Text.IsEncrypted) ?>: <?cs if:Data.Plugins.format_fs.container_type == "luks" ?><?cs
|
<p><?cs var:html_escape(Lang.Plugins.format_fs.Text.IsEncrypted) ?>: <?cs if:Data.Plugins.format_fs.container_type == "luks" ?><?cs
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
<div id="doc">
|
<div id="doc">
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<?cs include:Settings.DocDir + '/' + Settings.Language + '/' + Data.Plugins.help.Page + '.html' ?>
|
<?cs include:Settings.DocDir + '/' + Settings.Language + '/' + Data.Plugins.help.Page + '.html' ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
29
pythonrewrite/plugins/help/unittests.py
Normal file
29
pythonrewrite/plugins/help/unittests.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
import WebInterfaceTestClass
|
||||||
|
from twill.errors import *
|
||||||
|
|
||||||
|
class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
|
||||||
|
|
||||||
|
def test_help_pages(self):
|
||||||
|
'''help pages should be available in different languages'''
|
||||||
|
|
||||||
|
## check english help pages
|
||||||
|
self.cmd.go(self.URL + "plugins/help?weblang=en")
|
||||||
|
self.cmd.find("Table of Contents")
|
||||||
|
self.cmd.find("Getting started")
|
||||||
|
|
||||||
|
self.cmd.go(self.URL + "plugins/help?weblang=de")
|
||||||
|
self.cmd.find("Table of Contents")
|
||||||
|
self.cmd.find("Wie geht es los")
|
||||||
|
|
||||||
|
self.cmd.go(self.URL + "plugins/help?weblang=si")
|
||||||
|
self.assertRaises(TwillAssertionError, self.cmd.notfind, "Table of Contents")
|
||||||
|
#TODO: add a slovene text here, as soon as the help is translated
|
||||||
|
|
||||||
|
self.cmd.go(self.URL + "plugins/help?weblang=fr")
|
||||||
|
self.assertRaises(TwillAssertionError, self.cmd.notfind, "Table of Contents")
|
||||||
|
#TODO: add a french text here, as soon as the help is translated
|
||||||
|
|
||||||
|
## test a random language - it should fall back to english
|
||||||
|
self.cmd.go(self.URL + "plugins/help?weblang=foobar")
|
||||||
|
self.assertRaises(TwillAssertionError, self.cmd.notfind, "Table of Contents")
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
|
|
||||||
<h1><?cs var:html_escape(Lang.Plugins.logs.Title.Log) ?></h1>
|
<h1><?cs var:html_escape(Lang.Plugins.logs.Title.Log) ?></h1>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<?cs if:Data.Plugins.logs.Content ?>
|
<?cs if:Data.Plugins.logs.Content ?>
|
||||||
<p class="console"><?cs var:Data.Plugins.logs.Content ?></p>
|
<p class="console"><?cs var:Data.Plugins.logs.Content ?></p>
|
||||||
<?cs else ?>
|
<?cs else ?>
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
<h1><?cs var:html_escape(Lang.Plugins.network.Title.Network) ?></h1>
|
<h1><?cs var:html_escape(Lang.Plugins.network.Title.Network) ?></h1>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<?cs call:print_form_header("set_ip", "plugins/network") ?>
|
<?cs call:print_form_header("set_ip", "plugins/network") ?>
|
||||||
|
|
||||||
<p><label for="ip"><?cs var:html_escape(Lang.Plugins.network.Text.IP) ?>: </label>
|
<p><label for="ip"><?cs var:html_escape(Lang.Plugins.network.Text.IP) ?>: </label>
|
||||||
|
@ -24,3 +26,5 @@
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<?cs call:help_link("CryptoBoxUserConfiguration") ?>
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,8 @@ class network(CryptoBoxPlugin.CryptoBoxPlugin):
|
||||||
ip = "%d.%d.%d.%d" % (int(ip1), int(ip2), int(ip3), int(ip4))
|
ip = "%d.%d.%d.%d" % (int(ip1), int(ip2), int(ip3), int(ip4))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.hdf["Data.Warning"] = "Plugins.network.InvalidIP"
|
self.hdf["Data.Warning"] = "Plugins.network.InvalidIP"
|
||||||
return None
|
self.__prepareFormData()
|
||||||
|
return "form_network"
|
||||||
if self.__setIP(ip):
|
if self.__setIP(ip):
|
||||||
self.cbox.log.info("the IP was successfully changed: %s" % ip)
|
self.cbox.log.info("the IP was successfully changed: %s" % ip)
|
||||||
self.hdf["Data.Success"] = "Plugins.network.IPChanged"
|
self.hdf["Data.Success"] = "Plugins.network.IPChanged"
|
||||||
|
|
|
@ -4,7 +4,7 @@ from network import CHANGE_IP_DELAY
|
||||||
|
|
||||||
class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
|
class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
|
||||||
|
|
||||||
def atest_ip_change(self):
|
def test_ip_change(self):
|
||||||
'''change of network address'''
|
'''change of network address'''
|
||||||
## the time module is necessary for the CHANGE_IP_DELAY
|
## the time module is necessary for the CHANGE_IP_DELAY
|
||||||
import time
|
import time
|
||||||
|
|
|
@ -95,12 +95,14 @@ class partition(CryptoBoxPlugin.CryptoBoxPlugin):
|
||||||
|
|
||||||
|
|
||||||
def __actionSelectDevice(self, args):
|
def __actionSelectDevice(self, args):
|
||||||
|
import CryptoBoxTools
|
||||||
block_devices = [e
|
block_devices = [e
|
||||||
for e in CryptoBoxTools.getParentBlockDevices()
|
for e in CryptoBoxTools.getParentBlockDevices()
|
||||||
if self.cbox.isDeviceAllowed(e)]
|
if self.cbox.isDeviceAllowed(e)]
|
||||||
counter = 0
|
counter = 0
|
||||||
for a in block_devices:
|
for a in block_devices:
|
||||||
self.hdf[self.hdf_prefix + "BlockDevices.%d" % counter] = a
|
self.hdf[self.hdf_prefix + "BlockDevices.%d.name" % counter] = a
|
||||||
|
self.hdf[self.hdf_prefix + "BlockDevices.%d.size" % counter] = CryptoBoxTools.getBlockDeviceSizeHumanly(a)
|
||||||
self.cbox.log.debug("found a suitable block device: %s" % a)
|
self.cbox.log.debug("found a suitable block device: %s" % a)
|
||||||
counter += 1
|
counter += 1
|
||||||
if self.withConfigPartition:
|
if self.withConfigPartition:
|
||||||
|
@ -241,22 +243,12 @@ class partition(CryptoBoxPlugin.CryptoBoxPlugin):
|
||||||
def __getAvailableDeviceSize(self, device):
|
def __getAvailableDeviceSize(self, device):
|
||||||
"""calculate the available size (MB) of the device
|
"""calculate the available size (MB) of the device
|
||||||
also consider a (possible) configuration partition"""
|
also consider a (possible) configuration partition"""
|
||||||
if not device: return 0
|
import CryptoBoxTools
|
||||||
rdev = os.stat(device).st_rdev
|
deviceSize = CryptoBoxTools.getBlockDeviceSize(device)
|
||||||
minor = os.minor(rdev)
|
if deviceSize < 0: return 0
|
||||||
major = os.major(rdev)
|
|
||||||
for f in file("/proc/partitions"):
|
|
||||||
try:
|
|
||||||
elements = f.split()
|
|
||||||
if len(elements) != 4: continue
|
|
||||||
if (int(elements[0]) == major) and (int(elements[1]) == minor):
|
|
||||||
deviceSize = int(elements[2])/1024
|
|
||||||
if self.withConfigPartition:
|
if self.withConfigPartition:
|
||||||
deviceSize -= self.ConfigPartition["size"]
|
deviceSize -= self.ConfigPartition["size"]
|
||||||
return deviceSize
|
return deviceSize
|
||||||
except ValueError:
|
|
||||||
pass
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
|
||||||
def __isWithConfigPartition(self, args):
|
def __isWithConfigPartition(self, args):
|
||||||
|
|
|
@ -4,14 +4,19 @@
|
||||||
|
|
||||||
<h1><?cs var:html_escape(Lang.Plugins.partition.Title.Partition) ?></h1>
|
<h1><?cs var:html_escape(Lang.Plugins.partition.Title.Partition) ?></h1>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<?cs if:subcount(Data.Plugins.partition.BlockDevices) > 0 ?>
|
<?cs if:subcount(Data.Plugins.partition.BlockDevices) > 0 ?>
|
||||||
|
|
||||||
<?cs call:print_form_header("select_device", "plugins/partition") ?>
|
<?cs call:print_form_header("select_device", "plugins/partition") ?>
|
||||||
|
|
||||||
|
<?cs call:hint(Lang.Plugins.partition.Text.WarningMessage) ?>
|
||||||
|
|
||||||
<p><label for="block_device"><?cs var:html_escape(Lang.Plugins.partition.Text.SelectDevice) ?>: </label><br/>
|
<p><label for="block_device"><?cs var:html_escape(Lang.Plugins.partition.Text.SelectDevice) ?>: </label><br/>
|
||||||
<select name="block_device" id="block_device" tabindex="1" size="0">
|
<select name="block_device" id="block_device" tabindex="1" size="0">
|
||||||
<?cs each:x = Data.Plugins.partition.BlockDevices
|
<?cs each:x = Data.Plugins.partition.BlockDevices
|
||||||
?><option><?cs var:html_escape(x) ?></option>
|
?><option value="<?cs var:html_escape(x.name) ?>"><?cs
|
||||||
|
var:html_escape(x.name) ?> (<?cs var:html_escape(x.size) ?>)</option>
|
||||||
<?cs /each ?>
|
<?cs /each ?>
|
||||||
</select></p>
|
</select></p>
|
||||||
|
|
||||||
|
@ -22,10 +27,6 @@
|
||||||
<?cs /if ?>
|
<?cs /if ?>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<p class="note">
|
|
||||||
<?cs var:html_escape(Lang.Plugins.partition.Text.WarningMessage) ?>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<input type="hidden" name="step" value="add_partition" />
|
<input type="hidden" name="step" value="add_partition" />
|
||||||
|
|
||||||
<div align="center"><table><tr>
|
<div align="center"><table><tr>
|
||||||
|
|
|
@ -4,14 +4,19 @@
|
||||||
|
|
||||||
<h1><?cs var:html_escape(Lang.Plugins.partition.Title.Partition) ?></h1>
|
<h1><?cs var:html_escape(Lang.Plugins.partition.Title.Partition) ?></h1>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<table class="partition">
|
<table class="partition">
|
||||||
|
<?cs if:Data.Plugins.partition.availSize > 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>
|
||||||
|
@ -51,9 +56,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?cs if:subcount(Data.Plugins.partition.Parts) > 0 ?>
|
<?cs if:subcount(Data.Plugins.partition.Parts) > 0 ?>
|
||||||
<p class="note">
|
<?cs call:hint(Lang.Plugins.partition.Text.WarningMessage) ?>
|
||||||
<?cs var:html_escape(Lang.Plugins.partition.Text.WarningMessage) ?>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<?cs call:print_form_header("part_finish", "plugins/partition") ?>
|
<?cs call:print_form_header("part_finish", "plugins/partition") ?>
|
||||||
<?cs include:Settings.PluginDir + "/partition/current_partition_info.cs" ?>
|
<?cs include:Settings.PluginDir + "/partition/current_partition_info.cs" ?>
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
<h1><?cs var:html_escape(Lang.Plugins.partition.Title.Partition) ?></h1>
|
<h1><?cs var:html_escape(Lang.Plugins.partition.Title.Partition) ?></h1>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<p><?cs var:html_escape(Lang.Plugins.partition.Text.ProgressInfo) ?>
|
<p><?cs var:html_escape(Lang.Plugins.partition.Text.ProgressInfo) ?>
|
||||||
<ul>
|
<ul>
|
||||||
<?cs loop: x = #0, subcount(Data.Plugins.partition.Parts)-1, #1 ?>
|
<?cs loop: x = #0, subcount(Data.Plugins.partition.Parts)-1, #1 ?>
|
||||||
|
|
10
pythonrewrite/plugins/partition/unittests.py
Normal file
10
pythonrewrite/plugins/partition/unittests.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import WebInterfaceTestClass
|
||||||
|
|
||||||
|
class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
|
||||||
|
|
||||||
|
def test_read_form(self):
|
||||||
|
url = self.URL + "plugins/partition?weblang=en"
|
||||||
|
self.register_auth(url)
|
||||||
|
self.cmd.go(url)
|
||||||
|
self.cmd.find('VERY careful')
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
table.plugin_list {
|
table.plugin_list {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
align:center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table.plugin_list td, table.plugin_list th {
|
table.plugin_list td, table.plugin_list th {
|
||||||
|
@ -15,12 +14,14 @@
|
||||||
|
|
||||||
<h1><?cs var:html_escape(Lang.Plugins.plugin_manager.Title.PluginManager) ?></h1>
|
<h1><?cs var:html_escape(Lang.Plugins.plugin_manager.Title.PluginManager) ?></h1>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
|
|
||||||
<?cs call:print_form_header("manage_plugins", "plugins/plugin_manager") ?>
|
<?cs call:print_form_header("manage_plugins", "plugins/plugin_manager") ?>
|
||||||
|
|
||||||
<h2><?cs var:html_escape(Lang.Plugins.plugin_manager.Text.SystemPlugins) ?></h2>
|
<h2><?cs var:html_escape(Lang.Plugins.plugin_manager.Text.SystemPlugins) ?></h2>
|
||||||
<p>
|
<p>
|
||||||
<table class="plugin_list" align="center">
|
<table class="plugin_list">
|
||||||
<tr>
|
<tr>
|
||||||
<th><?cs var:html_escape(Lang.Plugins.plugin_manager.Text.PluginName) ?></th>
|
<th><?cs var:html_escape(Lang.Plugins.plugin_manager.Text.PluginName) ?></th>
|
||||||
<th><?cs var:html_escape(Lang.Plugins.plugin_manager.Text.PluginRank) ?></th>
|
<th><?cs var:html_escape(Lang.Plugins.plugin_manager.Text.PluginRank) ?></th>
|
||||||
|
@ -39,7 +40,7 @@
|
||||||
|
|
||||||
<h2><?cs var:html_escape(Lang.Plugins.plugin_manager.Text.VolumePlugins) ?></h2>
|
<h2><?cs var:html_escape(Lang.Plugins.plugin_manager.Text.VolumePlugins) ?></h2>
|
||||||
<p>
|
<p>
|
||||||
<table class="plugin_list" align="center">
|
<table class="plugin_list">
|
||||||
<tr>
|
<tr>
|
||||||
<th><?cs var:html_escape(Lang.Plugins.plugin_manager.Text.PluginName) ?></th>
|
<th><?cs var:html_escape(Lang.Plugins.plugin_manager.Text.PluginName) ?></th>
|
||||||
<th><?cs var:html_escape(Lang.Plugins.plugin_manager.Text.PluginRank) ?></th>
|
<th><?cs var:html_escape(Lang.Plugins.plugin_manager.Text.PluginRank) ?></th>
|
||||||
|
|
12
pythonrewrite/plugins/plugin_manager/unittests.py
Normal file
12
pythonrewrite/plugins/plugin_manager/unittests.py
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import WebInterfaceTestClass
|
||||||
|
|
||||||
|
class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
|
||||||
|
|
||||||
|
def test_read_form(self):
|
||||||
|
url = self.URL + "plugins/plugin_manager?weblang=en"
|
||||||
|
self.register_auth(url)
|
||||||
|
self.cmd.go(url)
|
||||||
|
self.cmd.find('Plugin Manager')
|
||||||
|
self.cmd.find('System plugins')
|
||||||
|
self.cmd.find('Volume plugins')
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
<h1><?cs var:html_escape(Lang.Plugins.shutdown.Title.Shutdown) ?></h1>
|
<h1><?cs var:html_escape(Lang.Plugins.shutdown.Title.Shutdown) ?></h1>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<p style="text-align: center">
|
<p style="text-align: center">
|
||||||
<?cs var:html_escape(Lang.Plugins.shutdown.Text.ShutdownInfo) ?>
|
<?cs var:html_escape(Lang.Plugins.shutdown.Text.ShutdownInfo) ?>
|
||||||
|
|
|
@ -6,6 +6,6 @@ class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
|
||||||
url = self.URL + "plugins/shutdown"
|
url = self.URL + "plugins/shutdown"
|
||||||
self.register_auth(url)
|
self.register_auth(url)
|
||||||
self.cmd.go(url)
|
self.cmd.go(url)
|
||||||
self.cmd.find('<form name="shutdown"')
|
self.cmd.find('plugins/shutdown\?type=reboot')
|
||||||
self.cmd.find('<form name="reboot"')
|
self.cmd.find('plugins/shutdown\?type=shutdown')
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
<h1><?cs var:html_escape(Lang.Plugins.system_preferences.Title.Preferences) ?></h1>
|
<h1><?cs var:html_escape(Lang.Plugins.system_preferences.Title.Preferences) ?></h1>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<?cs # sort the Plugins - using the most stupid way :) ?>
|
<?cs # sort the Plugins - using the most stupid way :) ?>
|
||||||
<?cs loop: order = #0, #100, #1
|
<?cs loop: order = #0, #100, #1
|
||||||
?><?cs # plugins ?><?cs each:x = Settings.PluginList
|
?><?cs # plugins ?><?cs each:x = Settings.PluginList
|
||||||
|
|
8
pythonrewrite/plugins/system_preferences/unittests.py
Normal file
8
pythonrewrite/plugins/system_preferences/unittests.py
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import WebInterfaceTestClass
|
||||||
|
|
||||||
|
class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
|
||||||
|
|
||||||
|
def test_preferences_overview(self):
|
||||||
|
self.cmd.go(self.URL + "plugins/system_preferences?weblang=en")
|
||||||
|
self.cmd.find("Preferences")
|
||||||
|
|
|
@ -6,7 +6,7 @@ from user_manager import RESERVED_USERS
|
||||||
class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
|
class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
|
||||||
|
|
||||||
def test_read_users(self):
|
def test_read_users(self):
|
||||||
print self._getUsers()
|
cur_users = self._getUsers()
|
||||||
# self.cmd.showforms()
|
# self.cmd.showforms()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
<h1><?cs var:html_escape(Lang.Plugins.user_manager.Title.UserManager) ?></h1>
|
<h1><?cs var:html_escape(Lang.Plugins.user_manager.Title.UserManager) ?></h1>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2><?cs var:html_escape(Lang.Plugins.user_manager.Title.AddUser) ?></h2>
|
<h2><?cs var:html_escape(Lang.Plugins.user_manager.Title.AddUser) ?></h2>
|
||||||
|
|
10
pythonrewrite/plugins/volume_details/unittests.py
Normal file
10
pythonrewrite/plugins/volume_details/unittests.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import WebInterfaceTestClass
|
||||||
|
|
||||||
|
class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
|
||||||
|
|
||||||
|
def test_read_form(self):
|
||||||
|
url = self.URL + "plugins/volume_details?weblang=en&device=%2Fdev%2Floop1"
|
||||||
|
self.register_auth(url)
|
||||||
|
self.cmd.go(url)
|
||||||
|
self.cmd.find('Technical details')
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
<h2><?cs var:html_escape(Lang.Plugins.volume_details.Title.Details) ?></h2>
|
<h2><?cs var:html_escape(Lang.Plugins.volume_details.Title.Details) ?></h2>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<p><ul>
|
<p><ul>
|
||||||
<li><?cs var:html_escape(Lang.Text.ContainerName) ?>: <?cs var:html_escape(Data.CurrentDisk.name) ?></li>
|
<li><?cs var:html_escape(Lang.Text.ContainerName) ?>: <?cs var:html_escape(Data.CurrentDisk.name) ?></li>
|
||||||
<li><?cs var:html_escape(Lang.Plugins.volume_details.Text.DeviceName) ?>: <?cs var:html_escape(Data.CurrentDisk.device) ?></li>
|
<li><?cs var:html_escape(Lang.Plugins.volume_details.Text.DeviceName) ?>: <?cs var:html_escape(Data.CurrentDisk.device) ?></li>
|
||||||
|
|
10
pythonrewrite/plugins/volume_mount/unittests.py
Normal file
10
pythonrewrite/plugins/volume_mount/unittests.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import WebInterfaceTestClass
|
||||||
|
|
||||||
|
class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
|
||||||
|
|
||||||
|
def test_read_form(self):
|
||||||
|
url = self.URL + "plugins/volume_mount?weblang=en&device=%2Fdev%2Floop1"
|
||||||
|
self.register_auth(url)
|
||||||
|
self.cmd.go(url)
|
||||||
|
self.cmd.find('ctivate volume')
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<h2><?cs var:html_escape(Lang.Plugins.volume_mount.Title.Mount) ?></h2>
|
<h2><?cs var:html_escape(Lang.Plugins.volume_mount.Title.Mount) ?></h2>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<p><?cs call:print_form_header("mount", "plugins/volume_mount") ?>
|
<p><?cs call:print_form_header("mount", "plugins/volume_mount") ?>
|
||||||
<input type="hidden" name="device" value="<?cs var:html_escape(Data.CurrentDisk.device) ?>" />
|
<input type="hidden" name="device" value="<?cs var:html_escape(Data.CurrentDisk.device) ?>" />
|
||||||
<?cs if:Data.CurrentDisk.encryption ?>
|
<?cs if:Data.CurrentDisk.encryption ?>
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<h2><?cs var:html_escape(Lang.Plugins.volume_mount.Title.Umount) ?></h2>
|
<h2><?cs var:html_escape(Lang.Plugins.volume_mount.Title.Umount) ?></h2>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<?cs call:print_form_header("umount", "plugins/volume_mount") ?>
|
<?cs call:print_form_header("umount", "plugins/volume_mount") ?>
|
||||||
<p><input type="hidden" name="device" value="<?cs var:html_escape(Data.CurrentDisk.device) ?>" />
|
<p><input type="hidden" name="device" value="<?cs var:html_escape(Data.CurrentDisk.device) ?>" />
|
||||||
<input type="hidden" name="action" value="umount" />
|
<input type="hidden" name="action" value="umount" />
|
||||||
|
|
10
pythonrewrite/plugins/volume_props/unittests.py
Normal file
10
pythonrewrite/plugins/volume_props/unittests.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import WebInterfaceTestClass
|
||||||
|
|
||||||
|
class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
|
||||||
|
|
||||||
|
def test_read_form(self):
|
||||||
|
url = self.URL + "plugins/volume_props?weblang=en&device=%2Fdev%2Floop1"
|
||||||
|
self.register_auth(url)
|
||||||
|
self.cmd.go(url)
|
||||||
|
self.cmd.find('Properties')
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
|
|
||||||
<h2><?cs var:html_escape(Lang.Plugins.volume_props.Title.Properties) ?></h2>
|
<h2><?cs var:html_escape(Lang.Plugins.volume_props.Title.Properties) ?></h2>
|
||||||
|
|
||||||
|
<?cs call:handle_messages() ?>
|
||||||
|
|
||||||
<?cs if:Data.CurrentDisk.active ?>
|
<?cs if:Data.CurrentDisk.active ?>
|
||||||
|
|
||||||
<div class="unavailable_action">
|
<?cs call:hint(Lang.Plugins.volume_props.Text.UmountBeforeProps) ?>
|
||||||
<?cs var:html_escape(Lang.Plugins.volume_props.Text.UmountBeforeProps) ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?cs else ?>
|
<?cs else ?>
|
||||||
<table>
|
<table>
|
||||||
|
|
Loading…
Reference in a new issue