Pyjoyment.Plugin - Plugin base class¶
# CamelCase plugin name
from Pyjoyment.Plugin import Plugin
class Pyjoyment_Plugin_MyPlugin(Plugin):
def register(self, app, conf):
# Magic here! :)
...
object = Pyjoyment_Plugin_MyPlugin
# Or import the module, as in Google Python Style Guide
# CamelCase plugin name
import Pyjoyment.Plugin
class Pyjoyment_Plugin_MyPlugin(Pyjoyment.Plugin.object):
def register(self, app, conf):
# Magic here! :)
...
object = Pyjoyment_Plugin_MyPlugin
Pyjoyment.Plugin is an abstract base class for Pyjoyment
plugins.
See Pyjoyment.Plugins for a list of plugins that are available by
default.
A plugin of another distribution is a module in the namespace
Pyjoyment.Plugin, which pkgutil.extend_path() keeps open, and the
class that the module names object.
See also¶
Pyjoyment, https://mojolicious.org.
Ported from Mojolicious::Plugin of Mojolicious 9.49.
- class Pyjoyment.Plugin.Pyjoyment_Plugin[source]¶
Pyjoyment.Plugininherits all methods fromPyjo.Baseand implements the following new ones.- register(app: Pyjoyment.object, conf: dict[str, Any]) Any[source]¶
plugin.register(Pyjoyment.new(), {}) plugin.register(Pyjoyment.new(), {'foo': 'bar'})
This method will be called by
Pyjoyment.Pluginsat startup time. Meant to be overloaded in a subclass.