diff --git a/plugins/plugin_template/form_plugin_template.cs b/plugins/plugin_template/form_plugin_template.cs new file mode 100644 index 0000000..f984ad2 --- /dev/null +++ b/plugins/plugin_template/form_plugin_template.cs @@ -0,0 +1,16 @@ + + + + + +
+ + + + + +

+

+ +
+ diff --git a/plugins/plugin_template/language.hdf b/plugins/plugin_template/language.hdf new file mode 100644 index 0000000..e2c87fd --- /dev/null +++ b/plugins/plugin_template/language.hdf @@ -0,0 +1,31 @@ +Name = Plugin template +Link = Template + +Title = This is a plugin template + +Text.Example = Think before you code. +Text.SecondExample = And while probably won't hurt! + +Help.Example = This template should help you with starting to write your own plugins. Please take a look in plugin-interfaces.txt for further assistance. + +SuccessMessage { + TemplateLaunched { + Title = You see ... + Text = an empty example for a plugin. + } +} + +WarningMessage { + SomeError { + Title = Invalid value + Text = This message will never appear. + } +} + +EnvironmentWarning { + MissingFoo { + Title = Plugin template warning example + Text = Use this to print some important warnings. + } +} + diff --git a/plugins/plugin_template/plugin_icon.gif b/plugins/plugin_template/plugin_icon.gif new file mode 100644 index 0000000..d5722d8 Binary files /dev/null and b/plugins/plugin_template/plugin_icon.gif differ diff --git a/plugins/plugin_template/plugin_icon.png b/plugins/plugin_template/plugin_icon.png new file mode 100644 index 0000000..769723d Binary files /dev/null and b/plugins/plugin_template/plugin_icon.png differ diff --git a/plugins/plugin_template/plugin_template.py b/plugins/plugin_template/plugin_template.py new file mode 100644 index 0000000..d64aec2 --- /dev/null +++ b/plugins/plugin_template/plugin_template.py @@ -0,0 +1,70 @@ +# +# Copyright 2006 sense.lab e.V. +# +# This file is part of the CryptoBox. +# +# The CryptoBox is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# The CryptoBox is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with the CryptoBox; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +"""This is a template for CryptoBox plugins + +requires: + - no extra software +""" + +__revision__ = "" + +import cryptobox.plugins.base + + +class plugin_template(cryptobox.plugins.base.CryptoBoxPlugin): + """a template for CryptoBox plugins + """ + + plugin_capabilities = [ "system" ] + plugin_visibility = [ "preferences" ] + request_auth = False + rank = 99 + + def do_action(self): + """The action handler. + """ + self.cbox.log.info("This is a log entry generated by the plugin_template.") + if True: + self.hdf["Data.Success"] = "Plugins.plugin_template.TemplateLaunched" + else: + self.hdf["Data.Warning"] = "Plugins.plugin_template.SomeError" + self.__prepare_form_data() + return "form_plugin_template" + + + def get_status(self): + """Retrieve the status of the feature. + """ + return + + + def get_warnings(self): + warnings = [] + ## uncomment this to see the environment warning message + #warnings.append((48, "Plugins.%s.MissingFoo" % self.get_name())) + return warnings + + + def __prepare_form_data(self): + """Set some hdf values. + """ + +