cdunklau: i wouldn't use inline callbacks for this
cdunklau
runciter: why not?
runciter
but that's a matter of style
cdunklau: harder to step through :)
cdunklau
runciter: step through how? reading, or when it blows up :)
runciter
cdunklau: *if* it blows up ;)
but yep
cdunklau
fair enough
i've gone overboard with inlineCallbacks on this project
like, 50% of my functions if not more use it
runciter
it's super useful!
again, it's a matter of style
there can be some weirdness with inline callbacks, too
but we can just hand wave that away!
cdunklau
so DeferredList won't errback if i don't give it a keyword arg, right?
runciter
cdunklau: ??
cdunklau: by default the deferred returned by a DeferredList won't fire until all the callbacks in the list have fired
gotta run!
runciter has quit
tos9 joined the channel
aalex joined the channel
rodrigc joined the channel
cdunklau
okay, so i have a DeferredList and i want to get the results and failures from each... but how do i stop the deferreds from thinking the errors are unhandled?
i can't use consumeErrors=True because that gets rid of the failures
ohhh if i add errbacks to the deferreds in the list that handle them, the deferred list still detects the failure
but only if i add the errbacks _after_ giving the list to DeferredList
asdf
i guess i'd add an errback to every individual deferred rather than going and looking at the accumulated results
if that works
cdunklau
asdf: yeah that's it. but you have to add it after handing it to the DeferredList, because the call/errbacks DeferredList adds to them just record which was called and pass the input through
foo2.py doesn't add the `lambda err: None` callback. the failed Deferred stays in the "errored" state, so when it gets collected, __del__ dumps that error
or... you know, however twisted does that
ah it's t.i.defer.DebugInfo that does that
moshez joined the channel
asdf
yes, i meant adding the errback before putting everything in DList
cdunklau
asdf: aha. well, if i do that, the DeferredList will tell me everything succeeded
asdf
yes
oh, you dont want that
iffy joined the channel
iffy has left the channel
rajesh joined the channel
rajesh has quit
rajesh joined the channel
cdunklau
asdf: right. the use case here is: after all the operations have completed (either succeeded or failed), i want to report a summary of the number of successes, number of failures, and the hosts for those that failed
I've got a script which contains a bug in twisted, how can I import the twisted git repo quicky into my python process so I can run it over and over?
asdf
reactormonk, clone the repo and `$ pip install -e directory/` it
then the code from the directory will be used so you can make changes to it etc
or is that not what you meant
reactormonk
asdf, I installed the dependencies via pacman, and `PYTHONPATH=src python /tmp/test.py` works
asdf
right
usually you'll want to use virtualenv+pip instead of your distro package manager, because some other programs that you install might require twisted (same for other libraries)
so virtualenv allows you to have a separate install of whatever version you need
and well distro repositories tend to have old versions of stuff
itamar has quit
reactormonk
More the other way, arch ships python 3.5, and twisted wants python 3.4 ^^
how do I tell listenUDP I want an ipv6 socket?
asdf
i think just need to provide a udp host
err `.listenUDP(1234, Proto(), interface='::1')` should do that i think?
Electrometro joined the channel
reactormonk
asdf, the default is to have the all ipv4 address, what's the ipv6 equivalent?
Electrometro joined the channel
asdf
just setting the interface to '::'
similarly setting the interface to '0.0.0.0' would be all ipv4
but its all ipv4 by default anyway, but not all ipv6 by default