Commit 9c3fece9 authored by louiz’'s avatar louiz’

Use slixmpp

parent 459471d7
......@@ -106,7 +106,7 @@ to upload you public key on a public server.
"""
from gpg import gnupg
from sleekxmpp.xmlstream.stanzabase import JID
from slixmpp.xmlstream.stanzabase import JID
from xml.etree import cElementTree as ET
import xml.sax.saxutils
......
......@@ -3,8 +3,8 @@ Show the exchanged IQs (useful for debugging).
"""
from plugin import BasePlugin
from sleekxmpp.xmlstream.matcher import StanzaPath
from sleekxmpp.xmlstream.handler import Callback
from slixmpp.xmlstream.matcher import StanzaPath
from slixmpp.xmlstream.handler import Callback
class Plugin(BasePlugin):
def init(self):
......
......@@ -58,7 +58,7 @@ import tabs
import datetime
import random
import re
from sleekxmpp.xmlstream.stanzabase import JID
from slixmpp.xmlstream.stanzabase import JID
class Plugin(BasePlugin):
def init(self):
......
......@@ -13,7 +13,7 @@ Command
"""
from plugin import BasePlugin
from common import parse_secs_to_str, safeJID
from sleekxmpp.xmlstream import ET
from slixmpp.xmlstream import ET
class Plugin(BasePlugin):
def init(self):
......
......@@ -11,7 +11,7 @@ bookmarks, both local and remote.
import logging
from sys import version_info
from sleekxmpp.plugins.xep_0048 import Bookmarks, Conference
from slixmpp.plugins.xep_0048 import Bookmarks, Conference
from common import safeJID
from config import config
......
......@@ -11,7 +11,7 @@ Various useful functions.
from sys import version_info
from datetime import datetime, timedelta
from sleekxmpp import JID, InvalidJID
from slixmpp import JID, InvalidJID
import base64
import os
......@@ -283,7 +283,7 @@ def find_delayed_tag(message):
"""
Check if a message is delayed or not.
:param sleekxmpp.Message message: The message to check.
:param slixmpp.Message message: The message to check.
:return: A tuple containing (True, the datetime) or (False, None)
:rtype: :py:class:`tuple`
"""
......@@ -521,7 +521,7 @@ def format_gaming_string(infos):
def safeJID(*args, **kwargs):
"""
Construct a :py:class:`sleekxmpp.JID` object from a string.
Construct a :py:class:`slixmpp.JID` object from a string.
Used to avoid tracebacks during is stringprep fails
(fall back to a JID with an empty string).
......
......@@ -454,7 +454,7 @@ def setup_logging():
log = logging.getLogger(__name__)
def post_logging_setup():
# common imports sleekxmpp, which creates then its loggers, so
# common imports slixmpp, which creates then its loggers, so
# it needs to be after logger configuration
from common import safeJID as JID
global safeJID
......
......@@ -14,15 +14,15 @@ log = logging.getLogger(__name__)
import getpass
import sleekxmpp
from sleekxmpp.plugins.xep_0184 import XEP_0184
import slixmpp
from slixmpp.plugins.xep_0184 import XEP_0184
import common
import fixes
from common import safeJID
from config import config, options
class Connection(sleekxmpp.ClientXMPP):
class Connection(slixmpp.ClientXMPP):
"""
Receives everything from Jabber and emits the
appropriate signals
......@@ -47,7 +47,7 @@ class Connection(sleekxmpp.ClientXMPP):
password = None
jid = safeJID(jid)
# TODO: use the system language
sleekxmpp.ClientXMPP.__init__(self, jid, password,
slixmpp.ClientXMPP.__init__(self, jid, password,
lang=config.get('lang', 'en'))
force_encryption = config.get('force_encryption', True)
......@@ -183,9 +183,9 @@ class Connection(sleekxmpp.ClientXMPP):
"""
if self.core:
self.core.outgoing_stanza(data)
sleekxmpp.ClientXMPP.send_raw(self, data, now, reconnect)
slixmpp.ClientXMPP.send_raw(self, data, now, reconnect)
class MatchAll(sleekxmpp.xmlstream.matcher.base.MatcherBase):
class MatchAll(slixmpp.xmlstream.matcher.base.MatcherBase):
"""
Callback to retrieve all the stanzas for the XML tab
"""
......
......@@ -62,7 +62,7 @@ class Contact(object):
"""
def __init__(self, item):
"""
item: a SleekXMPP RosterItem pointing to that contact
item: a slixmpp RosterItem pointing to that contact
"""
self.__item = item
self.folded_states = defaultdict(lambda: True)
......
......@@ -11,9 +11,9 @@ from datetime import datetime
from gettext import gettext as _
from xml.etree import cElementTree as ET
from sleekxmpp.xmlstream.stanzabase import StanzaBase
from sleekxmpp.xmlstream.handler import Callback
from sleekxmpp.xmlstream.matcher import StanzaPath
from slixmpp.xmlstream.stanzabase import StanzaBase
from slixmpp.xmlstream.handler import Callback
from slixmpp.xmlstream.matcher import StanzaPath
import bookmark
import common
......
......@@ -19,7 +19,7 @@ from threading import Event
from datetime import datetime
from gettext import gettext as _
from sleekxmpp.xmlstream.handler import Callback
from slixmpp.xmlstream.handler import Callback
import bookmark
import connection
......
......@@ -11,9 +11,9 @@ import time
from hashlib import sha1
from gettext import gettext as _
from sleekxmpp import InvalidJID
from sleekxmpp.stanza import Message
from sleekxmpp.xmlstream.stanzabase import StanzaBase
from slixmpp import InvalidJID
from slixmpp.stanza import Message
from slixmpp.xmlstream.stanzabase import StanzaBase
import bookmark
import common
......@@ -1058,7 +1058,7 @@ def incoming_stanza(self, stanza):
def validate_ssl(self, pem):
"""
Check the server certificate using the sleekxmpp ssl_cert event
Check the server certificate using the slixmpp ssl_cert event
"""
if config.get('ignore_certificate', False):
return
......
"""
Module used to provide fixes for sleekxmpp functions not yet fixed
Module used to provide fixes for slixmpp functions not yet fixed
upstream.
TODO: Check that they are fixed and remove those hacks
"""
from sleekxmpp.stanza import Message
from sleekxmpp.xmlstream import ET
from slixmpp.stanza import Message
from slixmpp.xmlstream import ET
import logging
......
......@@ -8,7 +8,7 @@
"""
Implementation of the XEP-0045: Multi-User Chat.
Add some facilities that are not available on the XEP_0045
sleek plugin
slix plugin
"""
from gettext import gettext as _
......
......@@ -339,21 +339,21 @@ class PluginAPI(object):
"""
return self.plugin_manager.del_event_handler(module, *args, **kwargs)
def add_sleek_event_handler(self, module, event_name, handler):
def add_slix_event_handler(self, module, event_name, handler):
"""
Add an event handler for a sleekxmpp event.
Add an event handler for a slixmpp event.
:param str event_name: The event name.
:param function handler: The handler function.
A list of the SleekXMPP events can be found here
A list of the slixmpp events can be found here
http://sleekxmpp.com/event_index.html
"""
self.core.xmpp.add_event_handler(event_name, handler)
def del_sleek_event_handler(self, module, event_name, handler):
def del_slix_event_handler(self, module, event_name, handler):
"""
Remove a handler for a SleekXMPP event
Remove a handler for a slixmpp event
:param str event_name: The name of the targeted event.
:param function handler: The function to remove from the handlers.
......
......@@ -261,7 +261,7 @@ class PluginManager(object):
def add_event_handler(self, module_name, event_name, handler, position=0):
"""
Add an event handler. If event_name isn’t in the event list, assume
it is a sleekxmpp event.
it is a slixmpp event.
"""
eh = self.event_handlers[module_name]
eh.append((event_name, handler))
......
......@@ -19,18 +19,18 @@ from roster_sorting import SORTING_METHODS, GROUP_SORTING_METHODS
from os import path as p
from datetime import datetime
from common import safeJID
from sleekxmpp.exceptions import IqError, IqTimeout
from slixmpp.exceptions import IqError, IqTimeout
class Roster(object):
"""
The proxy class to get the roster from SleekXMPP.
The proxy class to get the roster from slixmpp.
Caches Contact and RosterGroup objects.
"""
def __init__(self):
"""
node: the RosterSingle from SleekXMPP
node: the RosterSingle from slixmpp
"""
self.__node = None
self.contact_filter = None # A tuple(function, *args)
......@@ -113,7 +113,7 @@ class Roster(object):
return self.contacts[jid]
def set_node(self, value):
"""Set the SleekXMPP RosterSingle for our roster"""
"""Set the slixmpp RosterSingle for our roster"""
self.__node = value
def get_groups(self, sort=''):
......
......@@ -11,7 +11,7 @@ log = logging.getLogger(__name__)
from . import ListTab
from sleekxmpp.plugins.xep_0030.stanza.items import DiscoItem
from slixmpp.plugins.xep_0030.stanza.items import DiscoItem
class AdhocCommandsListTab(ListTab):
plugin_commands = {}
......
......@@ -11,7 +11,7 @@ log = logging.getLogger(__name__)
from . import ListTab
from sleekxmpp.plugins.xep_0030.stanza.items import DiscoItem
from slixmpp.plugins.xep_0030.stanza.items import DiscoItem
class MucListTab(ListTab):
"""
......
......@@ -11,8 +11,8 @@ import logging
log = logging.getLogger(__name__)
import curses
from sleekxmpp.xmlstream import matcher
from sleekxmpp.xmlstream.handler import Callback
from slixmpp.xmlstream import matcher
from slixmpp.xmlstream.handler import Callback
from . import Tab
......
......@@ -14,7 +14,7 @@ poezio colors to xhtml code
import re
import curses
from sleekxmpp.xmlstream import ET
from slixmpp.xmlstream import ET
from io import BytesIO
from xml import sax
......
......@@ -24,23 +24,15 @@ then
exit -1
fi
if [ -e "SleekXMPP" ]
if [ -e "slixmpp" ]
then
echo "Removing the old SleekXMPP"
rm -rf SleekXMPP
rm src/sleekxmpp
git clone https://github.com/fritzy/SleekXMPP.git Sleek || error SleekXMPP
fi
if [ -e "Sleek" ]
then
echo "Updating SleekXMPP"
cd Sleek
git pull || error SleekXMPP
echo "Updating slixmpp"
cd slixmpp
git pull || error slixmpp
cd ..
else
echo "Downloading SleekXMPP"
git clone https://github.com/fritzy/SleekXMPP.git Sleek || error SleekXMPP
echo "Downloading slixmpp"
git clone git://git.louiz.org/slixmpp || error slixmpp
fi
if [ -e ".dnspython.tgz" ]
......@@ -69,10 +61,10 @@ else
echo "Creating link src/dns"
ln -s ../dnspython/dns dns
fi
if [ -h "sleekxmpp" ]
if [ -h "slixmpp" ]
then
echo 'Link src/sleekxmpp already exists'
echo 'Link src/slixmpp already exists'
else
echo "Creating link src/sleekxmpp"
ln -s ../Sleek/sleekxmpp sleekxmpp
echo "Creating link src/slixmpp"
ln -s ../slixmpp/slixmpp slixmpp
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment