Commit Graph

34 Commits

Author SHA1 Message Date
Jeffrey Baitis 4a46a7a195 Modified source to work under python3 2016-09-02 13:05:03 -07:00
Yann Leboulanger 06a477da8a ability to compite the installer for gtk3 version 2016-07-07 22:41:35 +02:00
Denis Fomin de9241ac11 fix plugin manager 2013-01-11 19:54:52 +04:00
Emmanuel Gil Peyrot ab7ce2b42e Use log.warning instead of the deprecated log.warn. 2013-01-05 11:26:22 +01:00
Yann Leboulanger 912f0e921d fix imports and many py3 changements 2013-01-02 13:54:02 +01:00
Yann Leboulanger 069bddbbcb remove call to unicode() 2013-01-01 21:06:16 +01:00
Yann Leboulanger 414e349345 python uses unicode internally 2013-01-01 19:44:25 +01:00
Denis Fomin bb5db97546 plugin system. checking the type of stored data. Fix #7220 2012-08-22 22:21:26 +04:00
Yann Leboulanger 971e0502c0 don't load unactivatable plugins 2012-04-30 21:04:37 +02:00
Yann Leboulanger 3fe07c9a14 ability for plugins to be activatable. True by default, but plugin can be non-activatable is a dep is missing for example. 2012-04-30 00:43:18 +02:00
Yann Leboulanger d37bdc7a89 tryin to unpickle a GNU dbm file doesn't produce the same exception as bsddb. Handle both. Fixes #7013 2011-10-13 22:23:40 +02:00
Yann Leboulanger 8305f6d68e fix upgrading from old plugin config files 2011-10-11 21:44:02 +02:00
Denis Fomin 71aeb800da prevent traceback 2011-10-11 22:27:41 +03:00
Denis Fomin 572248b077 fix previos commit 2011-10-10 22:06:30 +03:00
Yann Leboulanger c0330a8685 stop using shelve, it cannot work when upgrading python version. Fixes #6988 2011-10-10 16:43:22 +02:00
Yann Leboulanger d598cbb041 remove old way of doing advanced notification. 2011-06-13 23:06:43 +02:00
Yann Leboulanger 409038784a dont' load plugin config file twice. Fixes #5914 2010-09-17 10:00:25 +02:00
Yann Leboulanger 96de172951 Fix running Gajim under windows for users with non-ascii char in account name. Fixes #5852 2010-09-10 21:31:25 +02:00
Éric Araujo 9b5ee1e13b convert tabs to spaces in source code thanks to reindent.py
Also use sed to remove now unneeded Vim lines, 2to3 -f ws_comma to fix
some whitespace, and fix some other madness manually.
2010-04-08 01:20:17 +02:00
Mateusz Biliński 06b6809b29 Added basic exception classes for handling plugins-related errors. 2009-04-28 15:14:38 +00:00
Mateusz Biliński c0a26be684 Three core (raw) events (iq, message, presence) go also through Network Events Controller (layer between network library and Global Events Dispatcher, newly added) and from there they are dispatched through Global Events Dispatcher.
Ability to register new incoming network events (based on exisiting one) added. Modify-only network events are possible (eg. add some text each message, but don't create any new global event). Events creation can be chained.
Examples of new network events classes are in New Events Example plugin.
Events from src/gajim.py now all go through Global Events Dispatcher and only through it (easy to modify, in chain, data passed with them).
2008-08-18 16:35:14 +00:00
Mateusz Biliński 06aee9d2d0 Initial version of Global Events Dispatcher.
Events previously generated for D-Bus support in remote_control.py go through Global Events Dispatcher now - this means any plugin can subscribe to them.
Implemented D-Bus support plugin based on remote_control.py.
2008-08-10 13:40:49 +00:00
Mateusz Biliński d1d3cc9bbd GUI extension points removal working properly now. 2008-08-03 22:02:53 +00:00
Mateusz Biliński 16ac65e58b Improvements to GUI extension points handling - added method to remove these from PluginManager (memory optimization).
Removed logging from most of the code.
2008-08-03 13:29:11 +00:00
Mateusz Biliński 8aa9cad2e0 Plugin's configuration is now saved to disk (currently: using UserDict and shelve modules).
Length Notifier Plugin has configuration dialog (added entry with JIDs to be included when plugin is working) - fully usable.

Default values of configuration key has been added to GajimPlugin.

Some other minor changes/fixes.
2008-07-29 19:09:28 +00:00
Mateusz Biliński d8075a23e6 Small sync commit. 2008-07-18 07:05:07 +00:00
Mateusz Biliński b647885d86 Small sync commit. 2008-07-05 16:44:27 +00:00
Mateusz Biliński aaf5b30129 Added GajimPluginConfigDialog class - dialog that plugins should use to present configuration to user.
Now, 'Configure' button is invoked only for plug-ins that have config_dialog.
2008-06-19 12:56:45 +00:00
Mateusz Biliński 8581b862e1 Added new 'init' method to Plugin class that plugins can implement to make actions that need to be done only once - when plugin is added (not activated) to Gajim. In this method plugins should declare handlers for GUI extension points. This was created so that __init__ method doesn't have to be reimplemented in specific way (create config, load config) - it is all done by __init__ in Plugin class. If __init__ is reimplemented, it must call Plugin __init__ (eg. using super() ) to plugin work properly.
Example plug-ins were modified to use init() instead of __init__().

Added new category in configuration - 'plugins'. It only holds one option for each plugin - 'active', which determines whether plugin should be activated on startup.

Now, Gajim remembers which plugins are active on exit, and activates them on next startup.
2008-06-18 20:45:22 +00:00
Mateusz Biliński b6593b9493 Plugin can be a package (directory) now. Added example plugin that modifies roster window (with glade file).
Added activate and deactivate methods to Plugin (used in forementioned RosterButtonsPlugin).
2008-06-14 18:20:24 +00:00
Mateusz Biliński 11e61ea2a2 Small changes toward handling plug-ins configuration. 2008-06-12 18:26:08 +00:00
Mateusz Biliński e127925948 Added first version of 'Plugins' window. It's accessible through 'Edit/Plugins' item in roster menu. It seems that you can successfully (de)activate plug-ins through GUI now.
Added 'homepage' attribute to Plugin class.

Added (commented out) calls of pycallgraph in src/gajim.py for later use.

[xbright] Changed 'python' to 'python2.5' because code uses modules not available in previous versions of Python.
2008-06-07 17:28:34 +00:00
Mateusz Biliński f62698e28c Added docstrings in reST format (also with todos). Commented out 'print' statements related to roster window. A few modifications to make code prettier (PyLint driven). 2008-06-02 23:15:08 +00:00
Mateusz Biliński 95b1e45920 Initial commit related to plug-in system:
- basic PluginManager class that loads plugins from *.py files
  in given directories
- Singleton metaclass was created to use with PluginManager;
  notice: __init__ of class is called only once (not like in code
	that is included in Python Cookbook)
- variable to keep paths of plugin directories has been created
  (common.gajim.PLUGINS_DIRS); also added initilization of these
  paths to common.ConfigPaths
- added global variable with PluginManager object:
  common.gajim.plugin_manager
- created customized logger for plugin system ('gajim.plugin_system')
- created function decorator plugins.helpers.log_calls which logs
  each call of function/method; it also logs when function is left
- base class Plugin for plug-in implementation added; not much
  here - only empty class attributes: name, short_name, authors,
	version, description
- based on Plugin class, first plugin was created named
  LengthNotifierPlugin; it is used to notify users when they
  exceed given length of message during writing it (text entry
  field highlights)
- first GUI extension points works when ChatControl object
  is created (it is used in mentioned plugin)
- added 'epydoc.conf' file customized a little bit (file
	is also in trunk now)
- fixed indentation in common.sleepy module (also in trunk
	now)
2008-06-01 23:33:51 +00:00