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