XSF logo XSF Discussion - 2013-01-17


  1. Alex has left
  2. arcriley >>> s = nodetree.Stream('<foo><bar>text content') >>> s.root.pop() Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: incomplete branch
  3. arcriley :-D
  4. arcriley just a few test regressions and debugs to cleanup and I think it'll be ready
  5. arcriley >>> s.send('</bar>') >>> s.root.pop() <bar>text content</bar>
  6. bear cool
  7. arcriley bear, so, lunch friday?
  8. bear sure
  9. bear do you have my number?
  10. arcriley yep its in my phone
  11. arcriley the plan is (still need to buy bus tix) head up friday morning and back sat night, tho the event im going to has a wishy-washy schedule
  12. bear I'm flexible so let me know what time range is good friday - I can be in town in 20min
  13. arcriley awesome
  14. arcriley btw i could use some ideas on how to represent namespaces in this api. i have a few, but its complicated by this not being a purely DOM model; a node can belong to nodes in multiple documents (tho not in the same document twice)
  15. arcriley the backend is libxml2 DOM but with a crazy complex linked list allowing a python object to hold multiple xml nodes while keeping the potential branches under them in sync.
  16. bear icky DOM is icky
  17. arcriley yea but its hard to implement xpath or xslt without it
  18. bear nods
  19. arcriley this project came from a convo i had with fritzy 2 years ago about the sad state of python xml packages and how much headache it was to implement xmpp, or any stream parsing, with them
  20. bear yea, python and stream processing are a bad mix
  21. bear need a middle ware solution that can be used by any script
  22. arcriley well python has had generators where yield can return a value (s.send() is an example) and coroutines for awhile, and has async now which uses that
  23. bear yea, but those are bolted onto a GIL that doesn't make for *real* event processing
  24. Lance python xml stream processing?
  25. Lance is interested
  26. arcriley Lance, yea nodetree.org - its nowhere near ready, but im about to push 0.3 release which adds this via nodetree.Stream class
  27. bear I was waiting for you :)
  28. Lance bear: he mentioned xpath :)
  29. arcriley no namespace support yet, no xpath/xslt support yet, but its going in as fast as i can. these early releases im mostly pushing to get feedback
  30. arcriley one of my goals is to be able to implement stanza routing via xslt
  31. arcriley i find a critical bug in the code for every hour or two i spend in it, too, though its becoming increasingly difficult to find the edge cases that produce them
  32. Lance arcriley if you want any help, let me know. this stuff would be great for sleekxmpp
  33. arcriley Lance, yea this came from a convo i had with fritzy regarding how much of a PITA it was to use lxml in sleekxmpp
  34. Lance ah, yeah
  35. Lance we switched to elementtree
  36. bear yea, elementtree is awesome(ish)
  37. arcriley plus, nodetree is already several times faster than either celementtree or lxml since we let libxml2 do the parsing, and lazy create the Python objects representing nodes on demand
  38. arcriley bear, elementtree is an awesome idea until you start to use it, and then it becomes a nightmare really fast. treating text nodes as a property of their parent element rather than as a node in the children list was a really bad design decision
  39. arcriley there's several warts on the API like that
  40. bear yea, I'm holding my nose and not "seeing" those issues because it allows me to not use libxml2 ;)
  41. arcriley i'm not saying libxml2's api is any better :-)
  42. arcriley my favorite complaint about etree is how to serialize nodes
  43. arcriley et.tostring(node)
  44. arcriley vs str(node)
  45. bear oh yea
  46. arcriley i've already implemented the latter, plus repr(node) will give a formatted tree.
  47. Lance hah, yeah. we just made our own serializer, that handled namespaces a little more sanely
  48. arcriley so in interactive python, if you type a node name by itself, you'll get it formatted with indentation/etc as above, and with repr() you can output that to a file should you choose
  49. arcriley Lance, would love your ideas on how to implement namespaces. obviously preserving both prefix and uri is important, and obviously namespace state needs to be carried with nodes when they're copied moved or disconnected from their parent, and obviously they should be able to be sanely managed from python programmatically
  50. arcriley the current code is in http://hg.nodetree.org/nodetree
  51. arcriley ignore the debug prints, they're kinda annoying, was tracking down memory management
  52. Lance arcriley: what are you trying to do better than elementtree with namespaces?
  53. arcriley i don't have a solid plan for namespaces yet, but etree's namespace handling is atrocious so not hard to improve on
  54. arcriley still brainstorming. until parsing was done it was kinda moot, and that just went in very recently
  55. bear goes to find dinner
  56. Lance arcriley you'll be at the summit?
  57. arcriley no can't afford to travel to europe right now. ill be at pycon tho
  58. Lance ok. i'll check out what you have so far and start playing with it
  59. Lance heads home
  60. arcriley 0.3 should be going out tomorrow. doing cleanup and getting the docs in order now
  61. Lance has joined
  62. Kev has left
  63. Kev has joined
  64. stpeter has left
  65. Ashley has left
  66. Jef has left
  67. Kev has left
  68. Lance has joined
  69. Ashley has joined
  70. Ashley has left
  71. Ashley has joined
  72. Ashley has left
  73. Ashley has joined
  74. Ashley has left
  75. Neustradamus has left
  76. Ashley has joined
  77. Ashley has left
  78. Neustradamus has joined
  79. Neustradamus has left
  80. arcriley lance, you going to pycon btw?
  81. arcriley i submitted a proposal for a XMPP poster session, if you're going you should do it with me to talk about sleekxmpp
  82. Lance i hadn't planned on it, but I certainly can
  83. Lance when is it?
  84. arcriley the poster session is usually on sunday, so march 17
  85. arcriley santa clara, ca
  86. Alex has joined
  87. Lance ok. i'll see if work will pay for travel and i'll let you know
  88. arcriley http://us.pycon.org/
  89. arcriley cool. if you can, then draft up a quick speaker profile on the site (just login and go to account, you don't have to register first) and i can add you as a speaker for the session
  90. Ashley has joined
  91. Ashley has left
  92. arcriley my experience with pycon poster sessions is you get a lot of people who're looking for a hammer for their pet screw, but its good to spread more general knowledge into the community. at the very least, have people know there's more to XMPP on Python than pyxmpp
  93. Alex has left
  94. Lance right :)
  95. Ashley has joined
  96. Neustradamus has joined
  97. Lance has joined
  98. Lloyd has joined
  99. Lance has joined
  100. Ashley has left
  101. Lance has joined
  102. Neustradamus has left
  103. Neustradamus has joined
  104. Ashley has joined
  105. Ashley has left
  106. Ashley has joined
  107. Ashley has left
  108. Kev has left
  109. Kev has left
  110. Zash has joined
  111. Neustradamus has left
  112. Neustradamus has joined
  113. Zash has left
  114. Nÿco has joined
  115. Neustradamus has joined
  116. Zash has joined
  117. stpeter has joined
  118. Lance has joined
  119. Lance has left
  120. Lance has joined
  121. Lance has joined
  122. Lloyd has left
  123. Lance has joined
  124. stpeter has left
  125. Lance arcriley: I'm approved so I'll write up a profile today
  126. stpeter has joined
  127. arcriley Lance, awesome ill invite you as a co-speaker for the poster
  128. arcriley also if you stay for the sprints we'll likely do xmpp stuff
  129. arcriley Lance Stout right?
  130. Lance yes
  131. arcriley cool invite sent
  132. Lance poor jabber.org server :(
  133. arcriley btw you in julython?
  134. Kev Yes. I wonder if the extra load is related to a bunch of really cool 'flooders', who seem to be kids who want to be hackers but lack the inclination to do anything more complicated than sending lots of messages.
  135. arcriley Kev, but havent you heard, flooding internet services with traffic is the modern equivalent to a protest! and so any anti-flooding strategy you put in place, including filtering source addresses, is the same as having riot police break up a protest and squash their first amendment rights
  136. Kev No, I hadn't heard that. Thankfully I don't speak 'stupid'.
  137. arcriley http://betabeat.com/2013/01/anonymous-wants-ddos-considered-free-speech-hops-on-the-white-house-petition-bandwagon/
  138. Kev Ah. Excellent.
  139. Kev It isn't, incidentally, DDoS attacks on jabber.org as far as I can tell.
  140. Kev Just a bunch of kids who like to join a MUC, send a few hundred/thousand messages and leave.
  141. Lance no, I'm not in julython. didn't even know what it was
  142. arcriley Lance, yea our team is first place. our team being copyleft games - including our google code-in students :-)
  143. Zash arcriley: Haha, what the crap
  144. arcriley Zash, iptables is the new pepper spray
  145. arcriley i think the next logical response of course is to physically tear gas ddos kiddies homes, then beat and arrest them when they flee the building
  146. Ashley has joined
  147. Zash has left
  148. Zash has joined
  149. Neustradamus has joined
  150. Lance has joined
  151. stpeter has left
  152. Lance has joined
  153. Zash has joined
  154. Neustradamus has left
  155. Neustradamus has joined
  156. Lance has joined
  157. Lance has joined
  158. Ashley has left
  159. Ashley has joined
  160. Lance has joined
  161. Lance has joined
  162. Neustradamus has left
  163. Neustradamus has joined
  164. Kev has left
  165. Jef has joined
  166. Jef has left
  167. Nÿco has left
  168. Jef has joined
  169. Ashley has left