Package plugins :: Module plugin :: Class GajimPlugin
[hide private]
[frames] | no frames]

Class GajimPlugin

source code


Base class for implementing Gajim plugins.
Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
save_config(self) source code
 
load_config(self) source code
 
__eq__(self, plugin) source code
 
__ne__(self, plugin) source code
 
local_file_path(self, file_name) source code
 
init(self) source code
 
activate(self) source code
 
deactivate(self) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
unicode name = u''
Name of plugin.
unicode short_name = u''
Short name of plugin.
unicode version = u''
Version of plugin.
unicode description = u''
Plugin description.
[] of unicode authors = []
Plugin authors.
unicode homepage = u''
URL to plug-in's homepage.
  gui_extension_points = {}
Extension points that plugin wants to connect with and handlers to be used.
{} of 2-element tuples config_default_values = {}
Default values for keys that should be stored in plug-in config.
{} with 2-element tuples events_handlers = {}
Dictionary with events handlers.
[] of nec.NetworkIncomingEvent or nec.NetworkOutgoingEvent events = []
New network event classes to be registered in Network Events Controller.
Instance Variables [hide private]
plugins.plugin.GajimPluginConfig config
Plug-in configuration dictionary.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Decorators:
  • @log_calls('GajimPlugin')
Overrides: object.__init__
(inherited documentation)

save_config(self)

source code 
Decorators:
  • @log_calls('GajimPlugin')

load_config(self)

source code 
Decorators:
  • @log_calls('GajimPlugin')

__eq__(self, plugin)
(Equality operator)

source code 

__ne__(self, plugin)

source code 

local_file_path(self, file_name)

source code 
Decorators:
  • @log_calls('GajimPlugin')

init(self)

source code 
Decorators:
  • @log_calls('GajimPlugin')

activate(self)

source code 
Decorators:
  • @log_calls('GajimPlugin')

deactivate(self)

source code 
Decorators:
  • @log_calls('GajimPlugin')

Class Variable Details [hide private]

name

Name of plugin.

Will be shown in plugins management GUI.

Type:
unicode
Value:
u''

short_name

Short name of plugin.

Used for quick indentification of plugin.

Type:
unicode

To Do: decide whether we really need this one, because class name (with module name) can act as such short name

Value:
u''

version

Version of plugin.
Type:
unicode

To Do: decide how to compare version between each other (which one is higher). Also rethink: do we really need to compare versions of plugins between each other? This would be only useful if we detect same plugin class but with different version and we want only the newest one to be active - is such policy good?

Value:
u''

description

Plugin description.
Type:
unicode

To Do: should be allow rich text here (like HTML or reStructuredText)?

Value:
u''

authors

Plugin authors.
Type:
[] of unicode

To Do: should we decide on any particular format of author strings? Especially: should we force format of giving author's e-mail?

Value:
[]

homepage

URL to plug-in's homepage.

using 'property')

Type:
unicode

To Do: should we check whether provided string is valid URI? (Maybe

Value:
u''

gui_extension_points

Extension points that plugin wants to connect with and handlers to be used.

Keys of this string should be strings with name of GUI extension point to handles. Values should be 2-element tuples with references to handling functions. First function will be used to connect plugin with extpoint, the second one to successfuly disconnect from it. Connecting takes places when plugin is activated and extpoint already exists, or when plugin is already activated but extpoint is being created (eg. chat window opens). Disconnecting takes place when plugin is deactivated and extpoint exists or when extpoint is destroyed and plugin is activate (eg. chat window closed).

Value:
{}

config_default_values

Default values for keys that should be stored in plug-in config.

This dict is used when when someone calls for config option but it has not been set yet.

Values are tuples: (default_value, option_description). The first one can be anything (this is the advantage of using shelve/pickle instead of custom-made config I/O handling); the second one should be unicode (gettext can be used if need and/or translation is planned).

Type:
{} of 2-element tuples
Value:
{}

events_handlers

Dictionary with events handlers.

Keys are event names. Values should be 2-element tuples with handler priority as first element and reference to handler function as second element. Priority is integer. See ged module for predefined priorities like ged.PRECORE, ged.CORE or ged.POSTCORE.

Type:
{} with 2-element tuples
Value:
{}

events

New network event classes to be registered in Network Events Controller.

subclasses.

Type:
[] of nec.NetworkIncomingEvent or nec.NetworkOutgoingEvent
Value:
[]

Instance Variable Details [hide private]

config

Plug-in configuration dictionary.

Automatically saved and loaded and plug-in (un)load.

Type:
plugins.plugin.GajimPluginConfig