[Twisted-Python] IPv6 comparison handling

2016-04-24 Thread Maciej Wasilak
noticed that Python 3 has nice new module "ipaddress" exactly for this kind of problems, and it has been backported to Python 2.7. Before I add it as a new dependency I wanted to ask if maybe Twisted has some other suggested solution for this pr

Re: [Twisted-Python] Twisted logger changes

2015-06-09 Thread Maciej Wasilak
ith 'twisted>=14.0.0' dependency on new system. Sorry! Thanks again for excellent work! Best Regards Maciej Wasilak ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

[Twisted-Python] Twisted logger changes

2015-06-08 Thread Maciej Wasilak
t, errors, True) exceptions.UnicodeDecodeError: 'utf8' codec can't decode byte 0xae in position 7: invalid start byte Although it is triggered by simple print, it seems to be caused by logging. Does new logging framework need any configuration

Re: [Twisted-Python] Twisted names client.getHostbyName dual-stack operation

2014-01-06 Thread Maciej Wasilak
wers. DeferToThread works fine, I just had the (wrong) impression that names is the preferred solution. Best Regards Maciej Wasilak ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

[Twisted-Python] Twisted names client.getHostbyName dual-stack operation

2014-01-06 Thread Maciej Wasilak
and built-in Python getaddrinfo(). My questions: 1. Is using deferToThread() a preferred solution? 2. Does someone know a less hacky solution to get IPv4 addresses with getHostbyName()? Best Regards Maciej Wasilak [1] http://stackoverflow.com/questions/13820175/can-twisted-names-client-be-f

Re: [Twisted-Python] txThings - simple library for CoAP protocol

2013-11-23 Thread Maciej Wasilak
of existing CoAP implementations. According to the first summary DTLS plugtest had 66% success rate - which means it's a though topic. Best regards Maciej Wasilak ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Re: [Twisted-Python] Setting source address of outgoing datagrams

2013-10-17 Thread Maciej Wasilak
l subclass. Best Regards Maciek 2013/10/16 Richard Wall > On 16 October 2013 12:47, Itamar Turner-Trauring > wrote: > > On 10/16/2013 03:36 AM, Maciej Wasilak wrote: > >> All in all the problem with using wrong source address can be easilly > >> solved with a bit

Re: [Twisted-Python] Setting source address of outgoing datagrams

2013-10-16 Thread Maciej Wasilak
Itamar, If you pass a specific IP to the interface keyword argument instead of > "::", the UDP port will bind to that specific IP and will only send > datagrams on that IP. You can use netifaces package (e.g. find it on PyPI) > to list all local IPs. So you could do the equivalent of "::" by bindi

[Twisted-Python] Setting source address of outgoing datagrams

2013-10-12 Thread Maciej Wasilak
read manually the destination address from the incoming request datagram, and set it as a source address manually in the outgoing response datagram? Best Regards Maciej Wasilak ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

[Twisted-Python] txThings - simple library for CoAP protocol

2013-09-20 Thread Maciej Wasilak
ibrary that supports Twisted, and allows building apps for Android and iOS - I've ran a few tests, and it's very promising :) Photo: http://bit.ly/1aPZ1ag Best Regards Maciej Wasilak ___ Twisted-Python mailing list Twisted-Python@twistedmatri

Re: [Twisted-Python] Passing additional arguments to errback

2013-09-06 Thread Maciej Wasilak
Hello, just one more question: Well, yes, you should, but still keep in mind that you can actually just > pass the request like so: > > .addErrback(handleErrors, request) > > You don't really have to save the request itself anywhere as an attribute. > if I understand correctly, when I put this i

Re: [Twisted-Python] Passing additional arguments to errback

2013-09-05 Thread Maciej Wasilak
Laurens, > You don't have to do it from in there. You can do > .addErrback(handleErrors, request), since it's all the same request object, > right? > Aaargh! I see the problem now. I wrote everything as part of the Protocol class (D&D - Deferreds&Dictionaries), when I should have extracted reque

Re: [Twisted-Python] Passing additional arguments to errback

2013-09-05 Thread Maciej Wasilak
Laurens, > Cześć Cześć! :) Thank you for your answer. I'm explicitly interested in the following combination: > .addCallback(cb).addErrback(eb) If I understand correctly errback "eb" catches errors from both callback "cb", and from agent.request (agent.request errors pass through default empty

[Twisted-Python] Passing additional arguments to errback

2013-09-04 Thread Maciej Wasilak
Dear list, I've found such a code example on "Stack Overflow" regarding errbacks: ___ class YourExample(object): def your_example(self): self.agent = Agent(reactor, pool=pool) self.deferred = self.agent.request( 'GET', se

Re: [Twisted-Python] Using Deferred.called to distinguish between synchronous and asynchronous result

2012-08-30 Thread Maciej Wasilak
Jean-Paul, thank you very much for your answer - I would have missed this problem for sure. Second option seems a bit more challenging, I'll try this one. Best Regards Maciej Wasilak 2012/8/29 > On 07:53 pm, wasi...@gmail.com wrote: > >Hello, > > > >I am implemen

[Twisted-Python] Using Deferred.called to distinguish between synchronous and asynchronous result

2012-08-29 Thread Maciej Wasilak
that sendResponse can send either ACK+RSP, or only RSP. I would like to ask if this is a proper approach? Best Regards Maciej Wasilak ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted