Plugins in Jabbim
Plugins in Jabbim are stored in ~/.jabbim/jabber@id.tld-profile/plugins directory or in plugins/ directory under Jabbim root directory. Every plugin must have its main class placed in a .py file named the same as its directory. E.g. Archive plugin will have the path: plugins/archive/archive.py. Archive.py is the main file of the plugin and it must define a class Plugin, whose constructor defines at least the members shown in this example:
from PyQt4 import QtCore, QtGui from include import plugins class Plugin(plugins.PluginBase): def __init__(self, main, homedir, plugindir): plugins.PluginBase.__init__(self, main, homedir, plugindir) self.fname = 'archive' # name of plugin directory self.description = 'Short description of the plugin' self.author = "Author" self.name = 'Official name of the plugin' self.version = '0.1' # version of the plugin, must be a float number self.category = ['archive'] # category of the plugin self.url = 'http://dev.jabbim.cz/jabbim' # url to homepage if main: # this part of code is processed when the plugin is loaded after Jabbim connects to the server # or after the plugin is enabled in preferences. self.loadConfig() # load config file for plugin print "plugin loaded" # log success into jabbim.log :) else: # this part is processed on plugin search on Jabbim client startup # and is purposed for internal needs of Jabbim client self.loadConfig(homedir)
This is the most simple plugin what makes nothing but runs on connection and stops after disconnection.
