Use absolute imports on all plugins
This is necessary because Gajim is with 0.16.11 a python package
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
[info]
|
||||
name: Regex Filter
|
||||
short_name: regex_filter
|
||||
version: 0.3
|
||||
version: 0.4
|
||||
description: Filter incoming messages using regex.
|
||||
authors: Yann Leboulanger <asterix@lagaule.org>
|
||||
homepage: http://trac-plugins.gajim.org/wiki/RegexFilterPlugin
|
||||
min_gajim_version: 0.16.10
|
||||
min_gajim_version: 0.16.11
|
||||
|
||||
@@ -26,13 +26,13 @@ Regex Filter plugin.
|
||||
|
||||
import re
|
||||
|
||||
from plugins import GajimPlugin
|
||||
from plugins.helpers import log, log_calls
|
||||
from gajim.plugins import GajimPlugin
|
||||
from gajim.plugins.helpers import log, log_calls
|
||||
|
||||
from common import gajim
|
||||
from common import ged
|
||||
from command_system.framework import CommandContainer, command, doc
|
||||
from command_system.implementation.hosts import *
|
||||
from gajim.common import app
|
||||
from gajim.common import ged
|
||||
from gajim.command_system.framework import CommandContainer, command, doc
|
||||
from gajim.command_system.implementation.hosts import *
|
||||
|
||||
class RegexFilterPlugin(GajimPlugin):
|
||||
|
||||
@@ -109,7 +109,7 @@ class FilterCommands(CommandContainer):
|
||||
@doc(_("Add an incoming filter. First argument is the search regex, "
|
||||
"second argument is the replace regex."))
|
||||
def add_filter(self, search, replace):
|
||||
plugin = gajim.plugin_manager.get_active_plugin('regex_filter')
|
||||
plugin = app.plugin_manager.get_active_plugin('regex_filter')
|
||||
plugin.add_rule(search, replace)
|
||||
return _('Added rule to replace %s by %s' % (search, replace))
|
||||
|
||||
@@ -117,7 +117,7 @@ class FilterCommands(CommandContainer):
|
||||
@doc(_("Remove an incoming filter. Argument is the rule number. "
|
||||
"See /list_rules command."))
|
||||
def remove_filter(self, num):
|
||||
plugin = gajim.plugin_manager.get_active_plugin('regex_filter')
|
||||
plugin = app.plugin_manager.get_active_plugin('regex_filter')
|
||||
if plugin.remove_rule(num):
|
||||
return _('Rule number %s removed' % num)
|
||||
return _('Rule number %s does not exist' % num)
|
||||
@@ -125,7 +125,7 @@ class FilterCommands(CommandContainer):
|
||||
@command("list_filters")
|
||||
@doc(_("List incoming filters."))
|
||||
def list_filters(self):
|
||||
plugin = gajim.plugin_manager.get_active_plugin('regex_filter')
|
||||
plugin = app.plugin_manager.get_active_plugin('regex_filter')
|
||||
rules = plugin.get_rules()
|
||||
st = ''
|
||||
for num, rule in rules.items():
|
||||
|
||||
Reference in New Issue
Block a user