From ec3a14e6d91e61c76147d8415f7246086fd9d435 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Sun, 3 Jul 2011 15:30:06 -0700 Subject: Updated XEP-0202 plugin to new format and use XEP-0082. --- sleekxmpp/plugins/xep_0202/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sleekxmpp/plugins/xep_0202/__init__.py (limited to 'sleekxmpp/plugins/xep_0202/__init__.py') diff --git a/sleekxmpp/plugins/xep_0202/__init__.py b/sleekxmpp/plugins/xep_0202/__init__.py new file mode 100644 index 00000000..82338d3a --- /dev/null +++ b/sleekxmpp/plugins/xep_0202/__init__.py @@ -0,0 +1,11 @@ +""" + SleekXMPP: The Sleek XMPP Library + Copyright (C) 2011 Nathanael C. Fritz, Lance J.T. Stout + This file is part of SleekXMPP. + + See the file LICENSE for copying permission. +""" + +from sleekxmpp.plugins.xep_0202 import stanza +from sleekxmpp.plugins.xep_0202.stanza import EntityTime +from sleekxmpp.plugins.xep_0202.time import xep_0202 -- cgit v1.2.3 From a0767f6af61bc9c54b2526cd51aef7af4e383e90 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Thu, 4 Aug 2011 00:07:30 -0700 Subject: Sadly, dateutil is not actually part of the standard lib. Thus, using the XEP-0082 and XEP-0202 introduces a dependency on the dateutil package (installable using pip install python-dateutil). Maybe we'll be able to rework how these plugins work to avoid needing dateutil, but for now this will have to do. --- sleekxmpp/plugins/xep_0202/__init__.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'sleekxmpp/plugins/xep_0202/__init__.py') diff --git a/sleekxmpp/plugins/xep_0202/__init__.py b/sleekxmpp/plugins/xep_0202/__init__.py index 82338d3a..3fb4744d 100644 --- a/sleekxmpp/plugins/xep_0202/__init__.py +++ b/sleekxmpp/plugins/xep_0202/__init__.py @@ -6,6 +6,23 @@ See the file LICENSE for copying permission. """ -from sleekxmpp.plugins.xep_0202 import stanza -from sleekxmpp.plugins.xep_0202.stanza import EntityTime -from sleekxmpp.plugins.xep_0202.time import xep_0202 +import logging +import sleekxmpp + + +log = logging.getLogger(__name__) + + +HAVE_DATEUTIL = True +try: + import dateutil +except: + HAVE_DATEUTIL = False + + +if HAVE_DATEUTIL: + from sleekxmpp.plugins.xep_0202 import stanza + from sleekxmpp.plugins.xep_0202.stanza import EntityTime + from sleekxmpp.plugins.xep_0202.time import xep_0202 +else: + log.warning("XEP-0202 requires the dateutil package") -- cgit v1.2.3 From 4d8933abdf4a190493f2762d423f469f6d8b30a9 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Thu, 4 Aug 2011 20:20:22 -0700 Subject: Actually, we can work around needing dateutil. If dateutil is present, we'll use that. If not, we'll use some regexes from the fixed_datetime module. --- sleekxmpp/plugins/xep_0202/__init__.py | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'sleekxmpp/plugins/xep_0202/__init__.py') diff --git a/sleekxmpp/plugins/xep_0202/__init__.py b/sleekxmpp/plugins/xep_0202/__init__.py index 3fb4744d..a34b2376 100644 --- a/sleekxmpp/plugins/xep_0202/__init__.py +++ b/sleekxmpp/plugins/xep_0202/__init__.py @@ -6,23 +6,7 @@ See the file LICENSE for copying permission. """ -import logging -import sleekxmpp - -log = logging.getLogger(__name__) - - -HAVE_DATEUTIL = True -try: - import dateutil -except: - HAVE_DATEUTIL = False - - -if HAVE_DATEUTIL: - from sleekxmpp.plugins.xep_0202 import stanza - from sleekxmpp.plugins.xep_0202.stanza import EntityTime - from sleekxmpp.plugins.xep_0202.time import xep_0202 -else: - log.warning("XEP-0202 requires the dateutil package") +from sleekxmpp.plugins.xep_0202 import stanza +from sleekxmpp.plugins.xep_0202.stanza import EntityTime +from sleekxmpp.plugins.xep_0202.time import xep_0202 -- cgit v1.2.3