xmlwaiter.py 784 B

123456789101112131415161718192021222324252627282930313233
  1. """
  2. SleekXMPP: The Sleek XMPP Library
  3. Copyright (C) 2010 Nathanael C. Fritz
  4. This file is part of SleekXMPP.
  5. See the file LICENSE for copying permission.
  6. """
  7. from sleekxmpp.xmlstream.handler import Waiter
  8. class XMLWaiter(Waiter):
  9. """
  10. The XMLWaiter class is identical to the normal Waiter class
  11. except that it returns the XML contents of the stanza instead
  12. of the full stanza object itself.
  13. Methods:
  14. prerun -- Overrides Waiter.prerun
  15. """
  16. def prerun(self, payload):
  17. """
  18. Store the XML contents of the stanza to return to the
  19. waiting event handler.
  20. Overrides Waiter.prerun
  21. Arguments:
  22. payload -- The matched stanza object.
  23. """
  24. Waiter.prerun(self, payload.xml)