Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=e86d840b57e30fd125f840266854eb0fd7fed644
commit e86d840b57e30fd125f840266854eb0fd7fed644 Author: crazy <[email protected]> Date: Sun Mar 6 01:03:35 2016 +0100 python3-sleekxmpp-1.3.0-1-x86_64 - removed - repo cleanup diff --git a/source/lib-extra/python3-sleekxmpp/FrugalBuild b/source/lib-extra/python3-sleekxmpp/FrugalBuild deleted file mode 100644 index 759d0df..0000000 --- a/source/lib-extra/python3-sleekxmpp/FrugalBuild +++ /dev/null @@ -1,25 +0,0 @@ -# Compiling Time: 0.01 SBU -# Maintainer: Anthony Jorion <[email protected]> - -pkgname=python3-sleekxmpp -pkgver=1.3.0 -pkgrel=1 -pkgdesc="XMPP library for Python" -archs=('i686' 'x86_64') -depends=('python-3.0>=3.4.0') -groups=('lib-extra') -_F_github_author="fritzy" -_F_github_name="SleekXMPP" -_F_github_tag=$pkgver -Finclude github -#source=(${source[@]} xep-0048.patch xep-0071.patch) -sha1sums=('0a1009e0de2fcd224dbf537a085774d565a475dc') - -build() { - cd $Fsrcdir || Fdie - unzip $pkgver ||Â Fdie - cd $_F_github_name-$pkgver || Fdie - #Fpatchall - Fcd - python3 setup.py install --root=$Fdestdir || Fdie -} diff --git a/source/lib-extra/python3-sleekxmpp/xep-0048.patch b/source/lib-extra/python3-sleekxmpp/xep-0048.patch deleted file mode 100644 index 4180424..0000000 --- a/source/lib-extra/python3-sleekxmpp/xep-0048.patch +++ /dev/null @@ -1,217 +0,0 @@ -From 6c0afb87b919f1f0321146323e917480851b2d63 Mon Sep 17 00:00:00 2001 -From: Lance Stout <[email protected]> -Date: Fri, 4 Jan 2013 00:26:18 -0800 -Subject: [PATCH] Add XEP-0048 support - ---- - setup.py | 1 + - sleekxmpp/plugins/__init__.py | 1 + - sleekxmpp/plugins/xep_0048/__init__.py | 15 +++++++ - sleekxmpp/plugins/xep_0048/bookmarks.py | 76 +++++++++++++++++++++++++++++++++ - sleekxmpp/plugins/xep_0048/stanza.py | 65 ++++++++++++++++++++++++++++ - 5 files changed, 158 insertions(+) - create mode 100644 sleekxmpp/plugins/xep_0048/__init__.py - create mode 100644 sleekxmpp/plugins/xep_0048/bookmarks.py - create mode 100644 sleekxmpp/plugins/xep_0048/stanza.py - -diff --git a/setup.py b/setup.py -index 1320361..ff11f8f 100755 ---- a/setup.py -+++ b/setup.py -@@ -67,6 +67,7 @@ - 'sleekxmpp/plugins/xep_0030/stanza', - 'sleekxmpp/plugins/xep_0033', - 'sleekxmpp/plugins/xep_0047', -+ 'sleekxmpp/plugins/xep_0048', - 'sleekxmpp/plugins/xep_0049', - 'sleekxmpp/plugins/xep_0050', - 'sleekxmpp/plugins/xep_0054', -diff --git a/sleekxmpp/plugins/__init__.py b/sleekxmpp/plugins/__init__.py -index 59d716e..4f9dda2 100644 ---- a/sleekxmpp/plugins/__init__.py -+++ b/sleekxmpp/plugins/__init__.py -@@ -25,6 +25,7 @@ - 'xep_0033', # Extended Stanza Addresses - 'xep_0045', # Multi-User Chat (Client) - 'xep_0047', # In-Band Bytestreams -+ 'xep_0048', # Bookmarks - 'xep_0049', # Private XML Storage - 'xep_0050', # Ad-hoc Commands - 'xep_0054', # vcard-temp -diff --git a/sleekxmpp/plugins/xep_0048/__init__.py b/sleekxmpp/plugins/xep_0048/__init__.py -new file mode 100644 -index 0000000..2c98d06 ---- /dev/null -+++ b/sleekxmpp/plugins/xep_0048/__init__.py -@@ -0,0 +1,15 @@ -+""" -+ SleekXMPP: The Sleek XMPP Library -+ Copyright (C) 2013 Nathanael C. Fritz, Lance J.T. Stout -+ This file is part of SleekXMPP. -+ -+ See the file LICENSE for copying permission. -+""" -+ -+from sleekxmpp.plugins.base import register_plugin -+ -+from sleekxmpp.plugins.xep_0048.stanza import Bookmarks, Conference, URL -+from sleekxmpp.plugins.xep_0048.bookmarks import XEP_0048 -+ -+ -+register_plugin(XEP_0048) -diff --git a/sleekxmpp/plugins/xep_0048/bookmarks.py b/sleekxmpp/plugins/xep_0048/bookmarks.py -new file mode 100644 -index 0000000..0bb5ae3 ---- /dev/null -+++ b/sleekxmpp/plugins/xep_0048/bookmarks.py -@@ -0,0 +1,76 @@ -+""" -+ SleekXMPP: The Sleek XMPP Library -+ Copyright (C) 2013 Nathanael C. Fritz, Lance J.T. Stout -+ This file is part of SleekXMPP. -+ -+ See the file LICENSE for copying permission. -+""" -+ -+import logging -+ -+from sleekxmpp import Iq -+from sleekxmpp.plugins import BasePlugin -+from sleekxmpp.exceptions import XMPPError -+from sleekxmpp.xmlstream.handler import Callback -+from sleekxmpp.xmlstream.matcher import StanzaPath -+from sleekxmpp.xmlstream import register_stanza_plugin -+from sleekxmpp.plugins.xep_0048 import stanza, Bookmarks, Conference, URL -+ -+ -+log = logging.getLogger(__name__) -+ -+ -+class XEP_0048(BasePlugin): -+ -+ name = 'xep_0048' -+ description = 'XEP-0048: Bookmarks' -+ dependencies = set(['xep_0045', 'xep_0049', 'xep_0060', 'xep_0163', 'xep_0223']) -+ stanza = stanza -+ default_config = { -+ 'auto_join': False, -+ 'storage_method': 'xep_0049' -+ } -+ -+ def plugin_init(self): -+ register_stanza_plugin(self.xmpp['xep_0060'].stanza.Item, Bookmarks) -+ -+ self.xmpp['xep_0049'].register(Bookmarks) -+ self.xmpp['xep_0163'].register_pep('bookmarks', Bookmarks) -+ -+ self.xmpp.add_event_handler('session_start', self._autojoin) -+ -+ def plugin_end(self): -+ self.xmpp.del_event_handler('session_start', self._autojoin) -+ -+ def _autojoin(self, __): -+ if not self.auto_join: -+ return -+ -+ try: -+ result = self.get_bookmarks(method=self.storage_method) -+ except XMPPError: -+ return -+ -+ if self.storage_method == 'xep_0223': -+ bookmarks = result['pubsub']['items']['item']['bookmarks'] -+ else: -+ bookmarks = result['private']['bookmarks'] -+ -+ for conf in bookmarks['conferences']: -+ if conf['autojoin']: -+ log.debug('Auto joining %s as %s', conf['jid'], conf['nick']) -+ self.xmpp['xep_0045'].joinMUC(conf['jid'], conf['nick'], -+ password=conf['password']) -+ -+ def set_bookmarks(self, bookmarks, method=None, **iqargs): -+ if not method: -+ method = self.storage_method -+ return self.xmpp[method].store(bookmarks, **iqargs) -+ -+ def get_bookmarks(self, method=None, **iqargs): -+ if not method: -+ method = self.storage_method -+ -+ loc = 'storage:bookmarks' if method == 'xep_0223' else 'bookmarks' -+ -+ return self.xmpp[method].retrieve(loc, **iqargs) -diff --git a/sleekxmpp/plugins/xep_0048/stanza.py b/sleekxmpp/plugins/xep_0048/stanza.py -new file mode 100644 -index 0000000..2e30eb6 ---- /dev/null -+++ b/sleekxmpp/plugins/xep_0048/stanza.py -@@ -0,0 +1,65 @@ -+""" -+ SleekXMPP: The Sleek XMPP Library -+ Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout -+ This file is part of SleekXMPP. -+ -+ See the file LICENSE for copying permission. -+""" -+ -+from sleekxmpp.xmlstream import ET, ElementBase, register_stanza_plugin -+ -+ -+class Bookmarks(ElementBase): -+ name = 'storage' -+ namespace = 'storage:bookmarks' -+ plugin_attrib = 'bookmarks' -+ interfaces = set() -+ -+ def add_conference(self, jid, nick, name=None, autojoin=None, password=None): -+ conf = Conference() -+ conf['jid'] = jid -+ conf['nick'] = nick -+ if name is None: -+ name = jid -+ conf['name'] = name -+ conf['autojoin'] = autojoin -+ conf['password'] = password -+ self.append(conf) -+ -+ def add_url(self, url, name=None): -+ saved_url = URL() -+ saved_url['url'] = url -+ if name is None: -+ name = url -+ saved_url['name'] = name -+ self.append(saved_url) -+ -+ -+class Conference(ElementBase): -+ name = 'conference' -+ namespace = 'storage:bookmarks' -+ plugin_attrib = 'conference' -+ plugin_multi_attrib = 'conferences' -+ interfaces = set(['nick', 'password', 'autojoin', 'jid', 'name']) -+ sub_interfaces = set(['nick', 'password']) -+ -+ def get_autojoin(self): -+ value = self._get_attr('autojoin') -+ return value in ('1', 'true') -+ -+ def set_autojoin(self, value): -+ del self['autojoin'] -+ if value in ('1', 'true', True): -+ self._set_sub_text('autojoin', 'true') -+ -+ -+class URL(ElementBase): -+ name = 'url' -+ namespace = 'storage:bookmarks' -+ plugin_attrib = 'url' -+ plugin_multi_attrib = 'urls' -+ interfaces = set(['url', 'name']) -+ -+ -+register_stanza_plugin(Bookmarks, Conference, iterable=True) -+register_stanza_plugin(Bookmarks, URL, iterable=True) --- -1.8.1.6 - diff --git a/source/lib-extra/python3-sleekxmpp/xep-0071.patch b/source/lib-extra/python3-sleekxmpp/xep-0071.patch deleted file mode 100644 index 1cacaaa..0000000 --- a/source/lib-extra/python3-sleekxmpp/xep-0071.patch +++ /dev/null @@ -1,279 +0,0 @@ -From 79a8c5ceae0cefb34d64172d95dded21872adf02 Mon Sep 17 00:00:00 2001 -From: Lance Stout <[email protected]> -Date: Thu, 18 Oct 2012 21:13:08 -0700 -Subject: [PATCH] Add proper XEP-0071 plugin. - ---- - setup.py | 1 + - sleekxmpp/basexmpp.py | 1 - - sleekxmpp/plugins/__init__.py | 1 + - sleekxmpp/plugins/xep_0071/__init__.py | 15 +++++++ - sleekxmpp/plugins/xep_0071/stanza.py | 73 ++++++++++++++++++++++++++++++++++ - sleekxmpp/plugins/xep_0071/xhtml_im.py | 30 ++++++++++++++ - sleekxmpp/stanza/htmlim.py | 71 ++------------------------------- - 7 files changed, 123 insertions(+), 69 deletions(-) - create mode 100644 sleekxmpp/plugins/xep_0071/__init__.py - create mode 100644 sleekxmpp/plugins/xep_0071/stanza.py - create mode 100644 sleekxmpp/plugins/xep_0071/xhtml_im.py - -diff --git a/setup.py b/setup.py -index ff11f8f..d9a492c 100755 ---- a/setup.py -+++ b/setup.py -@@ -75,6 +75,7 @@ - 'sleekxmpp/plugins/xep_0060', - 'sleekxmpp/plugins/xep_0060/stanza', - 'sleekxmpp/plugins/xep_0066', -+ 'sleekxmpp/plugins/xep_0071', - 'sleekxmpp/plugins/xep_0077', - 'sleekxmpp/plugins/xep_0078', - 'sleekxmpp/plugins/xep_0080', -diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py -index c3ff5ba..a54e4bb 100644 ---- a/sleekxmpp/basexmpp.py -+++ b/sleekxmpp/basexmpp.py -@@ -201,7 +201,6 @@ def __init__(self, jid='', default_ns='jabber:client'): - # Initialize a few default stanza plugins. - register_stanza_plugin(Iq, Roster) - register_stanza_plugin(Message, Nick) -- register_stanza_plugin(Message, HTMLIM) - - def start_stream_handler(self, xml): - """Save the stream ID once the streams have been established. -diff --git a/sleekxmpp/plugins/__init__.py b/sleekxmpp/plugins/__init__.py -index 4ff53ac..b1a73d9 100644 ---- a/sleekxmpp/plugins/__init__.py -+++ b/sleekxmpp/plugins/__init__.py -@@ -32,6 +32,7 @@ - 'xep_0059', # Result Set Management - 'xep_0060', # Pubsub (Client) - 'xep_0066', # Out of Band Data -+ 'xep_0071', # XHTML-IM - 'xep_0077', # In-Band Registration - # 'xep_0078', # Non-SASL auth. Don't automatically load - 'xep_0080', # User Location -diff --git a/sleekxmpp/plugins/xep_0071/__init__.py b/sleekxmpp/plugins/xep_0071/__init__.py -new file mode 100644 -index 0000000..c21e926 ---- /dev/null -+++ b/sleekxmpp/plugins/xep_0071/__init__.py -@@ -0,0 +1,15 @@ -+""" -+ SleekXMPP: The Sleek XMPP Library -+ Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout -+ This file is part of SleekXMPP. -+ -+ See the file LICENSE for copying permissio -+""" -+ -+from sleekxmpp.plugins.base import register_plugin -+ -+from sleekxmpp.plugins.xep_0071.stanza import XHTML_IM -+from sleekxmpp.plugins.xep_0071.xhtml_im import XEP_0071 -+ -+ -+register_plugin(XEP_0071) -diff --git a/sleekxmpp/plugins/xep_0071/stanza.py b/sleekxmpp/plugins/xep_0071/stanza.py -new file mode 100644 -index 0000000..7795754 ---- /dev/null -+++ b/sleekxmpp/plugins/xep_0071/stanza.py -@@ -0,0 +1,73 @@ -+""" -+ SleekXMPP: The Sleek XMPP Library -+ Copyright (C) 2012 Nathanael C. Fritz -+ This file is part of SleekXMPP. -+ -+ See the file LICENSE for copying permission. -+""" -+ -+from sleekxmpp.stanza import Message -+from sleekxmpp.thirdparty import OrderedDict -+from sleekxmpp.xmlstream import ElementBase, ET, register_stanza_plugin, tostring -+ -+ -+XHTML_NS = 'http://www.w3.org/1999/xhtml' -+ -+ -+class XHTML_IM(ElementBase): -+ -+ namespace = 'http://jabber.org/protocol/xhtml-im' -+ name = 'html' -+ interfaces = set(['body']) -+ lang_interfaces = set(['body']) -+ plugin_attrib = name -+ -+ def set_body(self, content, lang=None): -+ if lang is None: -+ lang = self.get_lang() -+ self.del_body(lang) -+ content = str(content) -+ header = '<body xmlns="%s"' % XHTML_NS -+ if lang: -+ header = '%s xml:lang="%s"' % (header, lang) -+ content = '%s>%s</body>' % (header, content) -+ xhtml = ET.fromstring(content) -+ self.xml.append(xhtml) -+ -+ def get_body(self, lang=None): -+ """Return the contents of the HTML body.""" -+ if lang is None: -+ lang = self.get_lang() -+ -+ bodies = self.xml.findall('{%s}body' % XHTML_NS) -+ -+ if lang == '*': -+ result = OrderedDict() -+ for body in bodies: -+ body_lang = body.attrib.get('{%s}lang' % self.xml_ns, '') -+ body_result = [] -+ body_result.append(body.text if body.text else '') -+ for child in body: -+ body_result.append(tostring(child, xmlns=XHTML_NS)) -+ body_result.append(body.tail if body.tail else '') -+ result[body_lang] = ''.join(body_result) -+ return result -+ else: -+ for body in bodies: -+ if body.attrib.get('{%s}lang' % self.xml_ns, self.get_lang()) == lang: -+ result = [] -+ result.append(body.text if body.text else '') -+ for child in body: -+ result.append(tostring(child, xmlns=XHTML_NS)) -+ result.append(body.tail if body.tail else '') -+ return ''.join(result) -+ return '' -+ -+ def del_body(self, lang): -+ if lang is None: -+ lang = self.get_lang() -+ bodies = self.xml.findall('{%s}body' % XHTML_NS) -+ for body in bodies: -+ if body.attrib.get('{%s}lang' % self.xml_ns, self.get_lang()) == lang: -+ self.xml.remove(body) -+ return -diff --git a/sleekxmpp/plugins/xep_0071/xhtml_im.py b/sleekxmpp/plugins/xep_0071/xhtml_im.py -new file mode 100644 -index 0000000..096a00a ---- /dev/null -+++ b/sleekxmpp/plugins/xep_0071/xhtml_im.py -@@ -0,0 +1,30 @@ -+""" -+ SleekXMPP: The Sleek XMPP Library -+ Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout -+ This file is part of SleekXMPP. -+ -+ See the file LICENSE for copying permission. -+""" -+ -+ -+from sleekxmpp.stanza import Message -+from sleekxmpp.plugins import BasePlugin -+from sleekxmpp.xmlstream import register_stanza_plugin -+from sleekxmpp.plugins.xep_0071 import stanza, XHTML_IM -+ -+ -+class XEP_0071(BasePlugin): -+ -+ name = 'xep_0071' -+ description = 'XEP-0071: XHTML-IM' -+ dependencies = set(['xep_0030']) -+ stanza = stanza -+ -+ def plugin_init(self): -+ register_stanza_plugin(Message, XHTML_IM) -+ -+ def session_bind(self, jid): -+ self.xmpp['xep_0030'].add_feature(feature=XHTML_IM.namespace) -+ -+ def plugin_end(self): -+ self.xmpp['xep_0030'].del_feature(feature=XHTML_IM.namespace) -diff --git a/sleekxmpp/stanza/htmlim.py b/sleekxmpp/stanza/htmlim.py -index d21a74e..c43178f 100644 ---- a/sleekxmpp/stanza/htmlim.py -+++ b/sleekxmpp/stanza/htmlim.py -@@ -7,78 +7,13 @@ - """ - - from sleekxmpp.stanza import Message --from sleekxmpp.xmlstream import ElementBase, ET, register_stanza_plugin -- -- --class HTMLIM(ElementBase): -- -- """ -- XEP-0071: XHTML-IM defines a method for embedding XHTML content -- within a <message> stanza so that lightweight markup can be used -- to format the message contents and to create links. -- -- Only a subset of XHTML is recommended for use with XHTML-IM. -- See the full spec at 'http://xmpp.org/extensions/xep-0071.html' -- for more information. -- -- Example stanza: -- <message to="[email protected]"> -- <body>Non-html message content.</body> -- <html xmlns="http://jabber.org/protocol/xhtml-im"> -- <body xmlns="http://www.w3.org/1999/xhtml"> -- <p><b>HTML!</b></p> -- </body> -- </html> -- </message> -- -- Stanza Interface: -- body -- The contents of the HTML body tag. -- -- Methods: -- setup -- Overrides ElementBase.setup. -- get_body -- Return the HTML body contents. -- set_body -- Set the HTML body contents. -- del_body -- Remove the HTML body contents. -- """ -- -- namespace = 'http://jabber.org/protocol/xhtml-im' -- name = 'html' -- interfaces = set(('body',)) -- plugin_attrib = name -- -- def set_body(self, html): -- """ -- Set the contents of the HTML body. -- -- Arguments: -- html -- Either a string or XML object. If the top level -- element is not <body> with a namespace of -- 'http://www.w3.org/1999/xhtml', it will be wrapped. -- """ -- if isinstance(html, str): -- html = ET.XML(html) -- if html.tag != '{http://www.w3.org/1999/xhtml}body': -- body = ET.Element('{http://www.w3.org/1999/xhtml}body') -- body.append(html) -- self.xml.append(body) -- else: -- self.xml.append(html) -- -- def get_body(self): -- """Return the contents of the HTML body.""" -- html = self.xml.find('{http://www.w3.org/1999/xhtml}body') -- if html is None: -- return '' -- return html -- -- def del_body(self): -- """Remove the HTML body contents.""" -- if self.parent is not None: -- self.parent().xml.remove(self.xml) -+from sleekxmpp.xmlstream import register_stanza_plugin -+from sleekxmpp.plugins.xep_0071 import XHTML_IM as HTMLIM - - - register_stanza_plugin(Message, HTMLIM) - -+ - # To comply with PEP8, method names now use underscores. - # Deprecated method names are re-mapped for backwards compatibility. - HTMLIM.setBody = HTMLIM.set_body --- -1.8.1.6 -
_______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
