X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Fomf%2Fomf_client.py;h=42f1d516d59f3780e0a21809dbef3a96b19b9a73;hb=2e80f0fafa0c2ef6a5f536efd4c868c91468f962;hp=87635e5e5fc177209b820720d52c5882ca18a06a;hpb=dac2434143d573f76c14eac647645d478cfb4f80;p=nepi.git diff --git a/src/nepi/resources/omf/omf_client.py b/src/nepi/resources/omf/omf_client.py index 87635e5e..42f1d516 100644 --- a/src/nepi/resources/omf/omf_client.py +++ b/src/nepi/resources/omf/omf_client.py @@ -20,19 +20,22 @@ from nepi.util.logger import Logger from nepi.resources.omf.omf6_parser import OMF6Parser - try: import sleekxmpp from sleekxmpp.exceptions import IqError, IqTimeout class BaseOMFClient(sleekxmpp.ClientXMPP): pass except ImportError: - print "SleekXMPP is not installed. Without this library, \n" + \ - " You will be not able to use OMF Resources \n"+ \ - " If you want to install SleekXmpp : \n"+ \ - " git clone -b develop git://github.com/fritzy/SleekXMPP.git \n"+ \ - " cd SleekXMPP \n"+ \ - "sudo python setup.py install\n" + msg = ("SleekXMPP is not installed. Without this library " + "you will be not able to use OMF Resources " + "if you want to install SleekXmpp: \n" + " git clone -b develop git://github.com/fritzy/SleekXMPP.git \n" + " cd SleekXMPP \n" + " sudo python setup.py install\n") + + logger = Logger("BaseOMFClient") + logger.debug(msg) + class BaseOMFClient(object): pass @@ -40,7 +43,7 @@ import traceback import xml.etree.ElementTree as ET # inherit from BaseXmpp and XMLstream classes -class OMFClient(sleekxmpp.ClientXMPP, Logger): +class OMFClient(BaseOMFClient, Logger): """ .. class:: Class Args : @@ -334,6 +337,14 @@ class OMFClient(sleekxmpp.ClientXMPP, Logger): self.error(msg) def check_mailbox(self, itype, attr): + """ Check the mail box + + :param itype: type of mail + :type itype: str + :param attr: value wanted + :type attr: str + + """ return self._parser.check_mailbox(itype, attr)