URLs changed to new plugin addressing scheme

svn:keywords set
fixed: shutdown - delay reboot/poweroff by some seconds to finish the web page before
added: format_fs - show link to umount in case of active device
added: new plugin "language_selection"
fixed: recently introduced syntax error in 'network'
added: "volume_props" mentions encryption support via "format_fs" (including link)
updated: plugin-interface.txt
fixed: broken test case for date plugin (caused by twill, I guess)
added: "partition" plugin - better handling of config partition
This commit is contained in:
lars 2006-11-06 06:17:22 +00:00
parent 7905fe7051
commit 80337411ae
49 changed files with 259 additions and 116 deletions

View file

@ -4,19 +4,12 @@
<?cs call:handle_messages() ?>
<!--
<p style="text-align: center">
<?cs var:html_escape(Lang.Plugins.shutdown.Text.ShutdownInfo) ?>
</p>
-->
<div class="plugin_system">
<a href="<?cs call:link('plugins/shutdown','type','shutdown','','') ?>">
<img src="<?cs call:link('icons/plugins/shutdown','image','gnome-shutdown.png','','')
<a href="<?cs call:link('shutdown','type','shutdown','','') ?>">
<img src="<?cs call:link('icons/shutdown','image','gnome-shutdown.png','','')
?>" alt="icon: shutdown" /><br/><?cs var:html_escape(Lang.Plugins.shutdown.Button.Shutdown) ?></a></div>
<div class="plugin_system">
<a href="<?cs call:link('plugins/shutdown','type','reboot','','') ?>">
<img src="<?cs call:link('icons/plugins/shutdown','image','gnome-reboot.png','','')
<a href="<?cs call:link('shutdown','type','reboot','','') ?>">
<img src="<?cs call:link('icons/shutdown','image','gnome-reboot.png','','')
?>" alt="icon: reboot" /><br/><?cs var:html_escape(Lang.Plugins.shutdown.Button.Reboot) ?></a></div>

View file

@ -2,11 +2,12 @@ Name = Shutdown or reboot the computer
Link = Shutdown
Title.Shutdown = Shutdown computer
Title.ProgressShutdown = The CryptoBox is shutting down
Title.ProgressReboot = The CryptoBox is rebooting
Button.Shutdown = Poweroff
Button.Reboot = Reboot
Text.ShutdownInfo = You may turn off or reboot your CryptoBox here.
SuccessMessage {
Shutdown {

View file

@ -0,0 +1,6 @@
<?cs # $Id$ ?>
<h1><?cs var:html_escape(Lang.Plugins.shutdown.Title.ProgressReboot) ?></h1>
<?cs call:handle_messages() ?>

View file

@ -0,0 +1,6 @@
<?cs # $Id$ ?>
<h1><?cs var:html_escape(Lang.Plugins.shutdown.Title.ProgressShutdown) ?></h1>
<?cs call:handle_messages() ?>

View file

@ -3,20 +3,20 @@
## necessary: otherwise CryptoBoxRootActions.py will refuse to execute this script
PLUGIN_TYPE = "cryptobox"
POWEROFF_BIN = "/sbin/poweroff"
REBOOT_BIN = "/sbin/reboot"
SHUTDOWN_BIN = "/sbin/shutdown"
## delay (in seconds) before shutdown
SHUTDOWN_DELAY = 3
import subprocess
import re
import sys
import os
def call_prog(progy):
proc = subprocess.Popen(
shell = False,
args = [progy])
proc.wait()
shell = False,
args = progy)
proc.communicate()
return proc.returncode == 0
@ -34,9 +34,9 @@ if __name__ == "__main__":
sys.exit(1)
if args[0] == "reboot":
result = call_prog(REBOOT_BIN)
result = call_prog([SHUTDOWN_BIN, "-t", str(SHUTDOWN_DELAY), "-r", "now"])
elif args[0] == "shutdown":
result = call_prog(POWEROFF_BIN)
result = call_prog([SHUTDOWN_BIN, "-t", str(SHUTDOWN_DELAY), "-h", "now"])
else:
sys.stderr.write("%s: illegal argument (%s)\n" % (self_bin, args[0]))
sys.exit(1)

View file

@ -6,7 +6,7 @@ class shutdown(CryptoBoxPlugin.CryptoBoxPlugin):
pluginCapabilities = [ "system", "menu" ]
requestAuth = False
rank = 70
rank = 90
def doAction(self, type=None):
if not type:
@ -14,7 +14,7 @@ class shutdown(CryptoBoxPlugin.CryptoBoxPlugin):
elif type == "shutdown":
if self.__doShutdown("shutdown"):
self.hdf["Data.Success"] = "Plugins.shutdown.Shutdown"
return None
return "progress_shutdown"
else:
self.hdf["Data.Warning"] = "Plugins.shutdown.ShutdownFailed"
return "form_shutdown"
@ -23,7 +23,7 @@ class shutdown(CryptoBoxPlugin.CryptoBoxPlugin):
self.hdf["Data.Success"] = "Plugins.shutdown.Reboot"
self.hdf["Data.Redirect.URL"] = ""
self.hdf["Data.Redirect.Delay"] = REDIRECT_DELAY
return None
return "progress_reboot"
else:
self.hdf["Data.Warning"] = "Plugins.shutdown.RebootFailed"
return "form_shutdown"

View file

@ -3,9 +3,9 @@ import WebInterfaceTestClass
class unittests(WebInterfaceTestClass.WebInterfaceTestClass):
def test_read_form(self):
url = self.URL + "plugins/shutdown"
url = self.URL + "shutdown"
self.register_auth(url)
self.cmd.go(url)
self.cmd.find('plugins/shutdown\?type=reboot')
self.cmd.find('plugins/shutdown\?type=shutdown')
self.cmd.find('shutdown\?type=reboot')
self.cmd.find('shutdown\?type=shutdown')