XSF Discussion - 2020-04-27


  1. jonas’

    \o/

  2. jonas’

    marc, the point of XSO is that you can map XML constructs to Python attributes / objects

  3. marc

    jonas’: yep, that's what I thought but I hab a damn typo and it didn't work :)

  4. jonas’

    :)

  5. marc

    jonas’: I guess I nees to register my classes such that they are decoded, right?

  6. jonas’

    if you’re using connect_xmlstream and send_and_wait_for, passing them to send_and_wait_for is all you need

  7. jonas’

    oh wow, send_and_wait_for has zero documentation

  8. marc

    Any special case for pre auth / stream elements?

  9. jonas’

    no

  10. jonas’

    send_and_wait_for is exactly for that

  11. jonas’

    first argument is the xmlstream, second argument is an iterable of XSOs you want to send, third argument is a sequence of XSO classes to listen for

  12. jonas’

    https://github.com/horazont/aioxmpp/blob/548dff57f878995262a861ee9530191afbdedd53/aioxmpp/protocol.py#L816

  13. jonas’

    also, feel free to file an issue for the lack of documentation of that function

  14. jonas’

    I’m @work, otherwise I’d fix that right away

  15. marc

    Okay, strange because it throws me an error that the element is unknown

  16. marc

    But I have to double check later

  17. jonas’

    you sure that your TAG is correct and you passed the right XSO?

  18. marc

    No, I'll check that later, thanks a lot so far!

  19. marc

    jonas’, What is the way to go when I want to have an Object that can contain different xml payloads?

  20. marc

    Do I need to inherit from a base class and specify the payload they in the child class or is it possible to use arbitrary child elements?

  21. jonas’

    marc, do you know the payloads beforehand?

  22. jonas’

    if so, xso.Child([...]) or xso.ChildList([...]) are good starting points

  23. jonas’

    (the possible payloads, you don’t need to know the specific payload)

  24. jonas’

    the list passed there is a list of XSO classes

  25. jonas’

    though we should move this to jdev@ or aioxmpp@

  26. marc

    Yep, can you send me the aioxmpp link?

  27. jonas’

    xmpp:aioxmpp@conference.zombofant.net?join

  28. jose

    andy

  29. Guus

    barbara

  30. edhelas

    john

  31. Zash

    greg

  32. Guus

    The first two contestants are out of our annual "names with the letter 'a'" competition!

  33. !XSF_Martin

    /me

  34. Maranda

    /them