plugin interface implemented
example plugins added: date and network moved "logs" to plugins
This commit is contained in:
parent
5af79f90b6
commit
dba8ca79fd
27 changed files with 483 additions and 174 deletions
13
pythonrewrite/plugins/logs/lang/en.hdf
Normal file
13
pythonrewrite/plugins/logs/lang/en.hdf
Normal file
|
@ -0,0 +1,13 @@
|
|||
Lang {
|
||||
|
||||
Title.Log = CryptoBox logfiles
|
||||
|
||||
Text.EmptyLog = The logfile of the CryptoBox is empty.
|
||||
|
||||
Modules.logs {
|
||||
Name = Show the content of the log file
|
||||
Link = Show the log file
|
||||
Rank = 90
|
||||
}
|
||||
|
||||
}
|
21
pythonrewrite/plugins/logs/logs.py
Normal file
21
pythonrewrite/plugins/logs/logs.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from CryptoBoxExceptions import CBPluginActionError
|
||||
|
||||
|
||||
def prepareForm(hdf, cbox):
|
||||
hdf["Data.Modules.logs.Content"] = __getLogContent(cbox)
|
||||
|
||||
|
||||
def doAction(cbox):
|
||||
return "show_log"
|
||||
|
||||
|
||||
def getStatus(cbox):
|
||||
return "%s:%s:%s" % (
|
||||
cbox.prefs["Log"]["Level"],
|
||||
cbox.prefs["Log"]["Destination"],
|
||||
cbox.prefs["Log"]["Details"])
|
||||
|
||||
|
||||
def __getLogContent(cbox, lines=30, maxSize=2000):
|
||||
return "<br/>".join(cbox.getLogData(lines, maxSize))
|
||||
|
13
pythonrewrite/plugins/logs/show_log.cs
Normal file
13
pythonrewrite/plugins/logs/show_log.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?cs # $Id: show_log.cs 374 2006-05-30 18:47:34Z lars $ ?>
|
||||
|
||||
<div id="log">
|
||||
|
||||
<h1><?cs var:html_escape(Lang.Title.Log) ?></h1>
|
||||
|
||||
<?cs if:Data.Modules.logs.Content ?>
|
||||
<p class="console"><?cs var:Data.Modules.logs.Content ?></p>
|
||||
<?cs else ?>
|
||||
<p><?cs var:html_escape(Lang.Text.EmptyLog) ?></p>
|
||||
<?cs /if ?>
|
||||
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue