From 0fe057b5c3f462275cf8dbf321c2ebec61de1bfe Mon Sep 17 00:00:00 2001 From: Sangeeth Saravanaraj Date: Tue, 27 Jan 2015 15:13:57 +0530 Subject: Boilerplate for Stanzas - request and response --- sleekxmpp/plugins/xep_0332/__init__.py | 1 + sleekxmpp/plugins/xep_0332/stanza.py | 19 ------------------- sleekxmpp/plugins/xep_0332/stanza/__init__.py | 12 ++++++++++++ sleekxmpp/plugins/xep_0332/stanza/request.py | 21 +++++++++++++++++++++ sleekxmpp/plugins/xep_0332/stanza/response.py | 21 +++++++++++++++++++++ 5 files changed, 55 insertions(+), 19 deletions(-) delete mode 100644 sleekxmpp/plugins/xep_0332/stanza.py create mode 100644 sleekxmpp/plugins/xep_0332/stanza/__init__.py create mode 100644 sleekxmpp/plugins/xep_0332/stanza/request.py create mode 100644 sleekxmpp/plugins/xep_0332/stanza/response.py (limited to 'sleekxmpp') diff --git a/sleekxmpp/plugins/xep_0332/__init__.py b/sleekxmpp/plugins/xep_0332/__init__.py index 3f80ce82..bdb951fc 100644 --- a/sleekxmpp/plugins/xep_0332/__init__.py +++ b/sleekxmpp/plugins/xep_0332/__init__.py @@ -11,5 +11,6 @@ from sleekxmpp.plugins.base import register_plugin from sleekxmpp.plugins.xep_0332.http import XEP_0332 +from sleekxmpp.plugins.xep_0332 import stanza register_plugin(XEP_0332) diff --git a/sleekxmpp/plugins/xep_0332/stanza.py b/sleekxmpp/plugins/xep_0332/stanza.py deleted file mode 100644 index 9d651d5d..00000000 --- a/sleekxmpp/plugins/xep_0332/stanza.py +++ /dev/null @@ -1,19 +0,0 @@ -""" - SleekXMPP: The Sleek XMPP Library - Implementation of HTTP over XMPP transport - http://xmpp.org/extensions/xep-0332.html - Copyright (C) 2015 Riptide IO, sangeeth@riptideio.com - This file is part of SleekXMPP. - - See the file LICENSE for copying permission. -""" - -from sleekxmpp.xmlstream import ElementBase - - -class Req(ElementBase): - pass - - -class Resp(ElementBase): - pass diff --git a/sleekxmpp/plugins/xep_0332/stanza/__init__.py b/sleekxmpp/plugins/xep_0332/stanza/__init__.py new file mode 100644 index 00000000..5d686710 --- /dev/null +++ b/sleekxmpp/plugins/xep_0332/stanza/__init__.py @@ -0,0 +1,12 @@ +""" + SleekXMPP: The Sleek XMPP Library + Implementation of HTTP over XMPP transport + http://xmpp.org/extensions/xep-0332.html + Copyright (C) 2015 Riptide IO, sangeeth@riptideio.com + This file is part of SleekXMPP. + + See the file LICENSE for copying permission. +""" + +from sleekxmpp.plugins.xep_0332.stanza.request import * +from sleekxmpp.plugins.xep_0332.stanza.response import * diff --git a/sleekxmpp/plugins/xep_0332/stanza/request.py b/sleekxmpp/plugins/xep_0332/stanza/request.py new file mode 100644 index 00000000..3d75b534 --- /dev/null +++ b/sleekxmpp/plugins/xep_0332/stanza/request.py @@ -0,0 +1,21 @@ +""" + SleekXMPP: The Sleek XMPP Library + Implementation of HTTP over XMPP transport + http://xmpp.org/extensions/xep-0332.html + Copyright (C) 2015 Riptide IO, sangeeth@riptideio.com + This file is part of SleekXMPP. + + See the file LICENSE for copying permission. +""" + +from sleekxmpp import Iq +from sleekxmpp.xmlstream import ElementBase, register_stanza_plugin +from sleekxmpp.plugins.xep_0131.stanza import Headers + + +class Request(ElementBase): + pass + + +register_stanza_plugin(Iq, Request) +register_stanza_plugin(Request, Headers) diff --git a/sleekxmpp/plugins/xep_0332/stanza/response.py b/sleekxmpp/plugins/xep_0332/stanza/response.py new file mode 100644 index 00000000..7f8180bb --- /dev/null +++ b/sleekxmpp/plugins/xep_0332/stanza/response.py @@ -0,0 +1,21 @@ +""" + SleekXMPP: The Sleek XMPP Library + Implementation of HTTP over XMPP transport + http://xmpp.org/extensions/xep-0332.html + Copyright (C) 2015 Riptide IO, sangeeth@riptideio.com + This file is part of SleekXMPP. + + See the file LICENSE for copying permission. +""" + +from sleekxmpp import Iq +from sleekxmpp.xmlstream import ElementBase, register_stanza_plugin +from sleekxmpp.plugins.xep_0131.stanza import Headers + + +class Response(ElementBase): + pass + + +register_stanza_plugin(Iq, Response) +register_stanza_plugin(Response, Headers) -- cgit v1.2.3