cryptonas/plugins/logs/logs.py
lars 112979b3af added setup.py to use distutils for packaging
moved python modules to separate packages below src/
renamed "hook" to "event" to avoid confusion
2006-11-23 19:13:08 +00:00

30 lines
751 B
Python

import cryptobox.plugins.base
import os
class logs(cryptobox.plugins.base.CryptoBoxPlugin):
pluginCapabilities = [ "system" ]
pluginVisibility = [ "preferences" ]
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))