cryptonas-branches/pythonrewrite/plugins/logs/logs.py
lars 11c2873934 moved "Rank" attribute from language file to plugin code
added plugin "plugin_manager"
added plugin "user_manager"
2006-10-11 15:50:24 +00:00

29 lines
699 B
Python

import CryptoBoxPlugin
import os
class logs(CryptoBoxPlugin.CryptoBoxPlugin):
pluginCapabilities = [ "system" ]
requestAuth = False
rank = 90
def doAction(self):
self.__prepareFormData()
return "show_log"
def getStatus(self):
return "%s:%s:%s" % (
self.cbox.prefs["Log"]["Level"],
self.cbox.prefs["Log"]["Destination"],
self.cbox.prefs["Log"]["Details"])
def __prepareFormData(self):
self.hdf[self.hdf_prefix + "Content"] = self.__getLogContent()
self.hdf[self.hdf_prefix + "StyleSheetFile"] = os.path.abspath(os.path.join(self.pluginDir, "logs.css"))
def __getLogContent(self, lines=30, maxSize=2000):
return "<br/>".join(self.cbox.getLogData(lines, maxSize))