Re: [Twisted-Python] naming question before we end up committed...

2014-09-26 Thread Laurens Van Houtven
+0 on “logger” (top-level names have a history of whimsy) +1 on making it top-level hth lvh signature.asc Description: Message signed with OpenPGP using GPGMail ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/c

Re: [Twisted-Python] GPRS/Modem protocol through USB support

2014-09-22 Thread Laurens Van Houtven
On 22 Sep 2014, at 17:31, Bram Van Steenlandt wrote: > No specific reason actually, I didn't even know twisted had support for a > serial port. > > This being said: > ftdio_sio can be a bit buggy at times, esp when using multiple devices on the > same pc, ftdi on freebsd & osx isn't very stabl

Re: [Twisted-Python] GPRS/Modem protocol through USB support

2014-09-22 Thread Laurens Van Houtven
Hi Bram & Simon, I’ll answer both e-mails in one go :-) On 22 Sep 2014, at 16:57, Bram Van Steenlandt wrote: > I'm using a gsm modem for sending sms messages, the modem is rs232 so I have > to use and ftdi adapter. > You can use these with pyserial in a thread in twisted. Huh! Interesting; wh

[Twisted-Python] inlineCallbacks and current exceptions: leaky abstraction or bug?

2014-07-28 Thread Laurens Van Houtven
Honored twistedeers, Consider the following (blocking) decorator, which runs a function in a transaction: def _with_transaction(f): def decorated(self, *args, **kwargs): conn = self.engine.connect() txn = conn.begin() try: result = f(self, conn, *args, *

Re: [Twisted-Python] [ANN] thimble 0.1.0

2014-05-19 Thread Laurens Van Houtven
On Mon, May 19, 2014 at 12:19 AM, Glyph wrote: > I think this is the sort of thing that should move into Twisted itself, > eventually. Thoughts? > I agree! There's a few things I'd like to work out with the freedom to break things of a v0.x.x semver version before that happens though. Notably,

[Twisted-Python] [ANN] thimble 0.1.0

2014-05-17 Thread Laurens Van Houtven
Hi everyone! thimble is a library that makes it easy to wrap blocking objects with a thread pool to give you an async API. In particular, it lets you selectively wrap blocking methods, and takes an explicit reactor and thread pool, making it at least slightly harder to do the obvious but potentia

Re: [Twisted-Python] The Twisted 14.0 Release Pre-Post-Mortem, and Where To From Here

2014-05-07 Thread Laurens Van Houtven
Hi! ​ First of all, thank you so much for working on this. Secondly, provided we don't find any regressions in pre5, option 2 seems the least footgunny to me :) hth lvh ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatr

Re: [Twisted-Python] Serial interface for software program

2014-05-05 Thread Laurens Van Houtven
Hi Anatoly, Do you know about manhole? I made a video that also demos axiom, but it should show you what manhole does :) https://www.youtube.com/watch?v=3-UZiO-AnLc Essentially it's "repl in a running process". hth lvh On Mon, May 5, 2014 at 4:43 AM, anatoly techtonik wrote: > Hello, netwo

Re: [Twisted-Python] txtorcon v0.9.2

2014-04-24 Thread Laurens Van Houtven
Thank you for all your work on this project :) On Thu, Apr 24, 2014 at 2:27 PM, meejah wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > I am happy to announce that txtorcon v0.9.2 is now available. > > This release adds a few minor bug-fixes and a few API > enhancements. Full deta

Re: [Twisted-Python] Twisted at PyCon 2014

2014-04-09 Thread Laurens Van Houtven
ruganti will be talking about how she implemented the happy > eyeballs algorithm (really! aka RFC 6555) - > https://us.pycon.org/2014/schedule/presentation/156/ > > Stacey Sern will present an introduction to Twisted - > https://us.pycon.org/2014/schedule/presentation/189/ &g

Re: [Twisted-Python] Getting the options object from the service

2014-03-17 Thread Laurens Van Houtven
Hi Jonas, I strongly prefer to pass the options around (through the Service objects you're making) rather than relying on the global state of the plugin instance. hth lvh On Mon, Mar 17, 2014 at 2:02 PM, Jonas Brunsgaard < jonas.brunsga...@gmail.com> wrote: > Hello Everybody > > What is the

Re: [Twisted-Python] Simple way to halt all timers?

2014-03-13 Thread Laurens Van Houtven
Hi Russell, The way to do this is to pass the reactor as a parameter, and use a Clock instead of the regular parameter for unit testing purposes. See also: https://twistedmatrix.com/documents/current/core/howto/trial.html ; that has a complete example of how to write unit tests that use Clock. T

Re: [Twisted-Python] git?

2014-03-13 Thread Laurens Van Houtven
Hi, On Thu, Mar 13, 2014 at 12:04 PM, Jonathan Ballet wrote: > Why does using Git involve moving tickets over to Github? > Why does using Git even involve Github at all, in the first place? > HawkOwl probably meant that it would be hard to get all the tooling (trac, ci...) working while switchi

Re: [Twisted-Python] which async framework?

2014-03-12 Thread Laurens Van Houtven
Hi Chris, It will probably not surprise you that I like Twisted :-) On Wed, Mar 12, 2014 at 8:28 AM, Chris Withers wrote: > So, I see python now has a plethora of async frameworks and I need to try > and pick one to use from: > > - asyncio/tulip > - tornado > - twisted > Twisted has a thing ca

Re: [Twisted-Python] Issues stemming from CVE-2014-1912?

2014-02-27 Thread Laurens Van Houtven
Hi Dustin, This exploit appears to be specific to how received data is written to the already existing buffer, so the _into forms of recv,recvfrom. Even if we assume there's a parallel export for regular recv_into and not just recvfrom_into (which hasn't been shown), Twisted never calls either of

Re: [Twisted-Python] maybe video

2014-02-26 Thread Laurens Van Houtven
Hi Kevin, Thanks for sharing, always nice to see people doing useful things with Twisted :-) lvh ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Re: [Twisted-Python] serializing inline callbacks

2014-02-18 Thread Laurens Van Houtven
On Tue, Feb 18, 2014 at 4:21 PM, Dustin J. Mitchell wrote: > D is returning a Deferred, but you're not doing anything with it. In > fact, all of A..E are returning Deferreds and you're ignoring them. > In an inlineCallbacks-decorated method, you need to yield every > Deferred you receive. > I re

Re: [Twisted-Python] Deadlocks when launching processes - how to investigate?

2014-02-15 Thread Laurens Van Houtven
Hi Orestis, Since creating processes involves syscalls, I would expect the tool of choice to debug this on OS X to be dtruss. I wish I could help on this endeavor but right now I'm focusing on fighting e-mail. (Brace yourself. PyCon is coming.) hth lvh _

Re: [Twisted-Python] positioning framework

2014-02-12 Thread Laurens Van Houtven
Hi Kasun! I'm lvh, the primary author of the ticket. On Wed, Feb 12, 2014 at 3:19 AM, Kasun Thennakoon wrote: > It took long time to go through the ticket[1] and understands, > still i couldn't find any issue with it, instead its working perfectly for > me. and thanks to the twisted positioning

Re: [Twisted-Python] Like to write some code for Twisted

2014-02-08 Thread Laurens Van Houtven
Hi Surya! First of all, thank you for offering up your free time to help Twisted. Specific advice: 1. Join #twisted 2. Join #twisted-dev 3. https://twistedmatrix.com/trac/wiki/ContributingToTwistedLabs hth lvh ___ Twisted-Python mailing list Twisted-

Re: [Twisted-Python] how to hire a Twisted developer to implement the feature?

2014-02-07 Thread Laurens Van Houtven
Hi Laurent, Apologies for brevity; I am on my phone. I am a Twisted core developer, and the author of minitrue, a software package that uses the proxy parts of Twisted. I am currently available for contracting. hth lvh On Feb 7, 2014 5:12 PM, "Laurent Domenech-Cabaud" wrote: > Hello, > > We're

Re: [Twisted-Python] Protocol for socket.io

2014-01-29 Thread Laurens Van Houtven
Hi Andrew, SockJS is a different project from socket.io; it just tries to solve a similar problem (WebSockets everywhere). If you literally need socket.io and not a similar thing in the same problem space, then SockJS will not help you. You can read about the spec for SockJS here: https://githu

[Twisted-Python] Python Events Calendar (Now with Twitter feed)

2014-01-29 Thread Laurens Van Houtven
Hi Twisters, Marc-Andre Lemburg from the PSF has been taking care of a Python events calendar for a while. It now has a twitter feed making it easier to find new events. If you're doing any Python-related events, such as of course Twisted sprints, or maybe Python user group meetups, please don't

Re: [Twisted-Python] Protocol for socket.io

2014-01-26 Thread Laurens Van Houtven
Hi Tobias, Hm. I can't find it in the current version. Either I am misremembering, or they expect you to use the pubsub thing as an RPC mechanism somehow (i.e. the room name is the procedure name). hth lvh ___ Twisted-Python mailing list Twisted-Python

Re: [Twisted-Python] Protocol for socket.io

2014-01-26 Thread Laurens Van Houtven
On Sun, Jan 26, 2014 at 10:57 AM, Glyph wrote: > > Having had the life-transforming experience of supporting customers using > *Government-*Quality Web Middleware Server Hardware Firewall™, in a > pre-websockets world, with a two-way web application... > > No, no I probably wouldn't. > Hah; okay

Re: [Twisted-Python] Protocol for socket.io

2014-01-26 Thread Laurens Van Houtven
On Sun, Jan 26, 2014 at 10:46 AM, Glyph wrote: > It would be great if someone built a package to do this (more interop is > always better), but I think interest has generally fizzled on Socket.IO > implementations in the past because SockJS does pretty much exactly the > same thing, and as Lauren

Re: [Twisted-Python] Protocol for socket.io

2014-01-25 Thread Laurens Van Houtven
Hi Andrew, No idea about socket.io, but if you're free to pick whatever you want, and you just want "websockets, damnit!" then sockjs is actually better, and has excellent twisted support. hth lvh ___ Twisted-Python mailing list Twisted-Python@twistedm

Re: [Twisted-Python] Limit headers by size and not by number in twisted.web

2014-01-22 Thread Laurens Van Houtven
Hi Adi, Awesome! Thank you for your research & contribution. lvh ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Re: [Twisted-Python] Limit headers by size and not by number in twisted.web

2014-01-22 Thread Laurens Van Houtven
Hi Adi, I'm assuming this is somewhat related to http://homakov.blogspot.be/2014/01/cookie-bomb-or-lets-break-internet.html:) I don't know of any mechanisms to limit cookie size. It's probably a good feature to have, and perhaps even enable by default. cheers lvh

Re: [Twisted-Python] Twisted and symlink

2014-01-21 Thread Laurens Van Houtven
Hi Toph, On Tue, Jan 21, 2014 at 4:14 PM, Toph Bei Fong wrote: > i was trying to port Python, Twisted, etc.. to VxWorks. > Ooh, exciting :) > My Problem now is: twisted/python/lockfile.py (import symlink). > VxWorks doenst support symlink. > > My Questions are: > * For what is the symlink us

Re: [Twisted-Python] Announcing pyOpenSSL 0.14a3

2014-01-21 Thread Laurens Van Houtven
On Tue, Jan 21, 2014 at 2:26 PM, wrote: > Hi Laurens, > > Right now pyOpenSSL trunk and the release branch only differ in the > version number they report. There are some important differences between > a2 and a3 though (so if you tested trunk before I announced a3 you might > not have tested th

Re: [Twisted-Python] Announcing pyOpenSSL 0.14a3

2014-01-21 Thread Laurens Van Houtven
Hi JP, FWIW, clarent appears to work fine against twisted and pyopenssl trunk. Is there a significant difference between the alpha and trunk (so that I should also test against the alpha specifically)? merlyn blows up, but that appears to be only because Axiom uses unsignedID, which has been rem

Re: [Twisted-Python] Better usage of Twisted on multi core processor

2014-01-20 Thread Laurens Van Houtven
Hi Sumanth, The first answer by JP Calderone (exarkun) on the following stackoverflow question may be of some assistance. http://stackoverflow.com/questions/10077745/twistedweb-on-multicore-multiprocessor This answer is from 2012; the good news is that the good API that JP talks about in his an

Re: [Twisted-Python] Maximum number of SSL connections to the server

2014-01-13 Thread Laurens Van Houtven
On Mon, Jan 13, 2014 at 3:19 PM, wrote: > select() has a hard limit that is often 1024. Make sure you're not using > the select()-based reactor (which I think is probably the default on OS X). > > Jean-Paul > What is the A-grade reactor on OS X? I thought it was cfreactor, but the docs appear t

Re: [Twisted-Python] Maximum number of SSL connections to the server

2014-01-13 Thread Laurens Van Houtven
Hi Sumanth, You probably want to look at the limits launchd is imposing. Consider: launchctl limit maxfiles 5000 5000 You can make this permanent by pumping that line (minus launchctl) into /etc/launchd.conf. hth lvh ___ Twisted-Python mailing list

Re: [Twisted-Python] Maximum number of SSL connections to the server

2014-01-13 Thread Laurens Van Houtven
Hi Sumanth, Still sounds like an open file problem. What platform? How did you set the number of files higher that 256? Take a look at /etc/security/limits.conf :-) cheers lvh ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twis

Re: [Twisted-Python] ISSLTransport.getPeerCertificate returning None?

2013-12-10 Thread Laurens Van Houtven
Somehow, JP's e-mail did not make it into my inbox :-( Anyway, using the context factory that I got from ssl.PrivateCertificate.options() (which I think is CertificateOptions), I wasn't able to inspect the peer certificate. That's on 13.2. Using the context factory I pasted in a previous e-mail, i

Re: [Twisted-Python] ISSLTransport.getPeerCertificate returning None?

2013-12-10 Thread Laurens Van Houtven
On Tue, Dec 10, 2013 at 9:41 AM, Phil Mayers wrote: > Unless you set the appropriate verify options on the server side too, the > client cert isn't available for inspection. > A-ha! But I want to do TOFU-POP; the certs are generated by the client, and there's little point in me signing them (I do

[Twisted-Python] ISSLTransport.getPeerCertificate returning None?

2013-12-09 Thread Laurens Van Houtven
Hi! I'm trying to authenticate a client by looking at their SSL certificate. I'm calling it from within an AMP responder (so, there's bytes going over the TLS transport already), and it's still None, so this is unrelated to calling it in connectionMade. That leads me to believe my client is doing

Re: [Twisted-Python] Unit testing AMP responder method registration

2013-12-04 Thread Laurens Van Houtven
On Wed, Dec 4, 2013 at 9:02 AM, wrote: > https://bazaar.launchpad.net/~game- hackers/game/trunk/view/head:/ > game/test/test_network.py#L418 > Thanks! I'll see how I can incorporate this. It does seem like the obvious test. Right now this is more spread out in my tests: I currently test the loc

[Twisted-Python] Unit testing AMP responder method registration

2013-12-03 Thread Laurens Van Houtven
Hi! I'm trying to write code using TDD and AMP. I'm trying to figure out how to write a unit test for: @MyCommand.responder Specifically, I would assume that test: 1. Tests that the responder locator has a responder for MyCommand; 2. That responder matches the decorated method (1) is easy, (2)

Re: [Twisted-Python] Some thoughts hacking with AMP (was: something about multiplexing and accessing protocols)

2013-11-23 Thread Laurens Van Houtven
On Fri, Nov 22, 2013 at 8:00 PM, Glyph wrote: > > On Nov 22, 2013, at 4:10 AM, Laurens Van Houtven <_...@lvh.io> wrote: > > Also, I do really really want the protocol and not the transport. This is > because I want to pass a reference to the protocol around so that later I

[Twisted-Python] Some thoughts hacking with AMP (was: something about multiplexing and accessing protocols)

2013-11-22 Thread Laurens Van Houtven
Hi, Some thoughts while hacking: - The argument having access to the responder locator and then eventually it going to a responder function is kind of useless, usually. The responder function already has a reference to the locator, usually called "self" :) - The locator object can be shared betwe

Re: [Twisted-Python] AMP Argument.toBox's proto argument is a locator, not the proto?

2013-11-20 Thread Laurens Van Houtven
*deep necromantic thread magic* On Thu, Oct 3, 2013 at 11:54 AM, Glyph wrote: > If I can change "proto" to mean "actually the protocol not something else" > then that seems plenty easy to add, and it would definitely be cool if > people don't have to mess with this nonsense themselves for someth

Re: [Twisted-Python] how to change an qt4 applicaion using twisted?

2013-11-17 Thread Laurens Van Houtven
On Sun, Nov 17, 2013 at 11:10 AM, yangyouxiu wrote: > Thank you very much. > > Is it reasonable to bulid only one protocol to deal with datas tranports > between client and server ? If in this way, i believe i have to write lots > of case to deal with the message, such as to call differnent meth

Re: [Twisted-Python] how to change an qt4 applicaion using twisted?

2013-11-17 Thread Laurens Van Houtven
Hi yangyouxiu, Like Twisted, Qt (and almost all GUI toolkits) work on a single thread, evented mechanism, with an event loop at its core. Qt4Reactor, I believe, just merges these two loops into one loop. The documentation for Qt4Reactor should tell you how to do that. Presumably there's a reacto

Re: [Twisted-Python] Error unmerging r40589

2013-11-06 Thread Laurens Van Houtven
Hi everyone, This was resolved. The error message is (of course) incorrect; the issue relates to trying to reopen a different ticket from the topfile you're removing. I've filed a ticket on twisted's trac integration: https://bugs.launchpad.net/twisted-trac-integration/+bug/1248491 cheers lvh __

[Twisted-Python] Error unmerging r40589

2013-11-06 Thread Laurens Van Houtven
Hi, I tried to review #2053. Unfortunately, the patch had a wrong name and a wrong topfile (the author was convinced they were working on 2503). I noticed the wrong patch name, but missed the wrong topfile. So, I'm trying to unmerge that revision (40589) from trunk using "svn merge -c -40589 .".

Re: [Twisted-Python] Limiting cipher options for SSH/SFTP

2013-10-30 Thread Laurens Van Houtven
Hi Ray! This seems like a clear failure of the documentation. Please file a ticket so that it can be alleviated at some point :) cheers lvh ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listin

Re: [Twisted-Python] Bytes vs unicode in twisted.python.logfile's python3 porting

2013-10-30 Thread Laurens Van Houtven
Hi Glyph, On Wed, Oct 30, 2013 at 1:22 AM, Glyph wrote: > > The new logging branch (destined for review Real Soon Now) is a bit more > rigorous about sensible behavior with respect to encoding, so we can > tighten up this behavior and make it work in more cases without breaking > compatibility.

Re: [Twisted-Python] Twisted 13.2.0pre1 Testing Feedback

2013-10-27 Thread Laurens Van Houtven
Hi Hawkowl, Thanks for managing the release! My stuff works fine :) cheers lvh ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Re: [Twisted-Python] Bytes vs unicode in twisted.python.logfile's python3 porting

2013-10-27 Thread Laurens Van Houtven
Hi JP, On Sun, Oct 27, 2013 at 2:19 AM, wrote: > *Or*, it now occurs to me, just stick with the ASCII-only policy that's > already in place. I'd even say this is more correct since porting isn't > supposed to change behavior. Leave support for some other codec for > another ticket (perhaps #9

[Twisted-Python] Bytes vs unicode in twisted.python.logfile's python3 porting

2013-10-26 Thread Laurens Van Houtven
Hi everyone, I'm working on #6749 for porting t.p.logfile to python3. I'm dealing with some test failures, which you can see from the buildbot here: http://buildbot.twistedmatrix.com/builders/python-3.3-tests/builds/1602/steps/shell/logs/stdio I have pasted the relevant bit into a gist here: h

Re: [Twisted-Python] AutobahnPython 0.6.3 - WebSocket compression and more

2013-10-06 Thread Laurens Van Houtven
Congratulations! Please keep the announcements coming. If I get a chance, I'll try to apply the recent attacks by Rizzo et al. on TLS compression and the compressed stream over TLS equivalent by Prado et al., since I like compression but I also send credentials over TLS :) cheers lvh

Re: [Twisted-Python] Help for Twisted + Thread + Message Queue

2013-10-04 Thread Laurens Van Houtven
On Fri, Oct 4, 2013 at 10:59 AM, Stefano Danzi wrote: > Hi Laurens, > many thanks for yours considerations. > > 1) I don't have problems about latency but I can't halt all during the > computation. Why not? > I can defer the computation for minutes if I attach to data the timestamp > related

Re: [Twisted-Python] Help for Twisted + Thread + Message Queue

2013-10-04 Thread Laurens Van Houtven
Hi Stefano, It's probably a good idea to avoid thinking in threads until they come up as a potential solution. Some questions: 1) What are the latency requirements? Is it okay for everything else to halt while you do that computation? What are the latency requirements for the computation? Is th

Re: [Twisted-Python] Conch - Why does one piece of code "fail" while another works

2013-10-02 Thread Laurens Van Houtven
On Wed, Oct 2, 2013 at 3:20 PM, wrote: > Where's the second piece of code? > The gist has two files in it. hth lvh ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Re: [Twisted-Python] AMP Argument.toBox's proto argument is a locator, not the proto?

2013-10-01 Thread Laurens Van Houtven
On Tue, Oct 1, 2013 at 12:59 AM, Glyph wrote: > Most of the code I can think of that wants to use that really wants the * > transport* rather than the "protocol", > Yes, but having the protocol would also immediately give you access to the transport, and, from what I understand in most cases of

Re: [Twisted-Python] AMP Argument.toBox's proto argument is a locator, not the proto?

2013-09-30 Thread Laurens Van Houtven
Hi Glyph, Thanks for your response! On Mon, Sep 30, 2013 at 8:41 PM, Glyph wrote: > On Sep 30, 2013, at 2:45 AM, Laurens Van Houtven <_...@lvh.io> wrote: > > What am I doing wrong? Is this a bug? > > > I think it's pretty clearly a bug. Calling the argument

[Twisted-Python] AMP Argument.toBox's proto argument is a locator, not the proto?

2013-09-30 Thread Laurens Van Houtven
Hi everyone, I think I've hit one of those cases where AMP really seems to want everything (locator, receiver, sender) to be an instance of t.p.amp.AMP :-( I've written some code that tries to multiplex stream transports over AMP: https://github.com/lvh/txampext/blob/multiplexing/txampext/multi

Re: [Twisted-Python] Clean pb solution for two-way object sync?

2013-09-27 Thread Laurens Van Houtven
Hi Daniel, If you're interested in PB, you may also be interested in Foolscap, the object-capability extension to PB. Foolscap lives at: http://foolscap.lothar.com/trac Feature overview: http://foolscap.lothar.com/trac/wiki/FoolscapFeatures cheers lvh

Re: [Twisted-Python] Cancelling a pb callRemote

2013-09-18 Thread Laurens Van Houtven
+1, particularly for AMP ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Re: [Twisted-Python] run python application with twistd -y ifinger.tac, error occurs. please help to check

2013-09-17 Thread Laurens Van Houtven
On Tue, Sep 17, 2013 at 2:14 PM, wrote: > I think there are still many unported dependencies of `twistd` to port > first. > Sure, but every little bit helps, right? :) > Can someone comment as to why this was put there in the first place, and, >> specifically, why it can't just be "pass"? Is

Re: [Twisted-Python] run python application with twistd -y ifinger.tac, error occurs. please help to check

2013-09-17 Thread Laurens Van Houtven
Hi Charles, Yes, twistd doesn't appear to work on py3k. Not being able to import _preamble is normal (once Twisted has been installed), but _preamble does assume sys.exc_clear exists, which isn't true on 3.x. I couldn't find any ticket on this. Perhaps you should file it (and maybe fix it!) :)

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

2013-09-05 Thread Laurens Van Houtven
On Thu, Sep 5, 2013 at 12:00 PM, Maciej Wasilak wrote: > 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 > c

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

2013-09-05 Thread Laurens Van Houtven
Hi, On Thu, Sep 5, 2013 at 9:24 AM, Maciej Wasilak wrote: > 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 (age

Re: [Twisted-Python] Is there a 'development mode ' for twisted ?

2013-09-05 Thread Laurens Van Houtven
On Thu, Sep 5, 2013 at 1:54 AM, a qi wrote: > HI, there > > I'm new to twisted, after reading the documents from twisted > websites, I got some questions: > > 1. Is there a 'development mode ' for twisted ? like django, you > can see your changes without restarting server. > Not

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

2013-09-04 Thread Laurens Van Houtven
Cześć Maciek :) In general, you can pass extra arguments when you call addCallback(s) or addErrback. They will get passed to the callback. However, as a side note to that code example, do you understand the difference between .addCallbacks(cb, eb) and: .addCallback(cb).addErrback(eb) and: .

Re: [Twisted-Python] Interesting plot on new author contributions post-Github for several Python packages

2013-08-27 Thread Laurens Van Houtven
On Tue, Aug 27, 2013 at 2:14 PM, wrote: > On 09:54 am, _...@lvh.io wrote: > >> IIUC, Tom does most of his contributing through Github. That probably >> means >> that it's a well-supported process that has most of the kinks ironed out: >> after all, if Tom hasn't caught them, I would guess a new c

Re: [Twisted-Python] Interesting plot on new author contributions post-Github for several Python packages

2013-08-27 Thread Laurens Van Houtven
IIUC, Tom does most of his contributing through Github. That probably means that it's a well-supported process that has most of the kinks ironed out: after all, if Tom hasn't caught them, I would guess a new contributor probably wouldn't either :-) cheers lvh __

Re: [Twisted-Python] Encouraging New Reviewers (was: Re: something about Github, as all threads about fostering community now start on that subject)

2013-08-27 Thread Laurens Van Houtven
On Tue, Aug 27, 2013 at 6:07 AM, Glyph wrote: > I think that's a fine rule, but it has one gigantic problem: we don't have > a list of committers anywhere. Making this list - and, critically, > associating VCS handle (svn.twistedmatrix.com login) with Trac handle, > for those cases where it diff

Re: [Twisted-Python] Advice Request: Under what circumstances should I use AMP's Command Response field?

2013-08-21 Thread Laurens Van Houtven
Hi Burak, I don't have time to write a more complete response right now, but you might want to get in touch with Pete Fein (@wearpants). He was trying to do this, but with the added restriction that it had to work on WinXP Tomato's opinion of IE6. cheers lvh __

Re: [Twisted-Python] Advice Request: Under what circumstances should I use AMP's Command Response field?

2013-08-21 Thread Laurens Van Houtven
Hi Burak, I think you're doing fine. Distributed systems are just kind of hard :-) It sounds like your fundamentally building an eventually consistent distributed database. We have a few of those already: it might be significantly less work to just use one of them. I suppose it depends why you'r

Re: [Twisted-Python] Advice Request: Under what circumstances should I use AMP's Command Response field?

2013-08-20 Thread Laurens Van Houtven
Hi Burak, On Tue, Aug 20, 2013 at 12:21 PM, Burak Nehbit wrote: > Hi there, > > I was meaning to ask you all about the 'proper' way to use AMP in regards > to two–way communication. The problem I am facing is quite simple, I am > building a simple peer–to–peer network in which the user: > > a) W

Re: [Twisted-Python] Twisted as a House for Sale

2013-08-19 Thread Laurens Van Houtven
Hi Matt, Loved the story, excited about the prospects. Just one nitpick: after one of Glyph's rants on gender-neutral words, I got tripped up by Ronnie not being referred to as "they" ;-) cheers lvh ___ Twisted-Python mailing list Twisted-Python@twiste

Re: [Twisted-Python] transport.write performance.

2013-08-07 Thread Laurens Van Houtven
On Wed, Aug 7, 2013 at 9:58 PM, Glyph wrote: > Just curious here: what version of PyPy did you do your tests with? From > what I've heard, the somewhat recently-released 2.1 should have improved > JSON parsing performance. > FWIW, Maciej commented that they don't expect to be *faster*, because

Re: [Twisted-Python] Multiplexing streams with Conch

2013-08-06 Thread Laurens Van Houtven
On Tue, Aug 6, 2013 at 2:14 AM, wrote: > This is still sort of incomprehensible to me. For example, you haven't > even said whether you're trying to develop the server side of this, the > client side, both, or what. I'm definitely trying to write the server. I'm hoping to be able to get out fr

Re: [Twisted-Python] Multiplexing streams with Conch

2013-08-05 Thread Laurens Van Houtven
Hi, Sorry, when editing and cutting my post I got rid of something important :-) When you log in, you get greeted by some terminal app, say something written with Urwid or so. In addition to that, on the client, you can start accepting connections on some TCP port, and at some point the server wi

[Twisted-Python] Multiplexing streams with Conch

2013-08-05 Thread Laurens Van Houtven
Hi, I'd like to do something akin to port forwarding using Conch. Specifically, I want to be able to make connections to something listening on a particular port on the client, and I want the client to be able to make connections to some ClientFactory in the server. Can I do this with regular SS

Re: [Twisted-Python] transport.write performance.

2013-07-31 Thread Laurens Van Houtven
On Jul 31, 2013 4:19 AM, "zipxing" wrote: > > Great! pypy take 20% cpu, 3x fast than cpython! > Thanks! > > A little problem: cjson and ujson can't install to pypy... What's wrong with the builtin json module? > ZipXing > > > > From: _...@lvh.io > > Date: Tue, 30

Re: [Twisted-Python] transport.write performance.

2013-07-30 Thread Laurens Van Houtven
On Tue, Jul 30, 2013 at 3:31 PM, Phil Mayers wrote: > Obviously if the OP using "send" without checking the return value, > they're doing it wrong! > Right, but that's what the OP's example does :) cheers lvh ___ Twisted-Python mailing list Twisted-Pyt

Re: [Twisted-Python] transport.write performance.

2013-07-30 Thread Laurens Van Houtven
On Tue, Jul 30, 2013 at 2:44 PM, Phil Mayers wrote: > For TCP? > Yes. See also the difference between socket.send and socket.sendall :) socket.send returns a number of bytes that it actually sent. cheers lvh ___ Twisted-Python mailing list Twisted-Pyt

Re: [Twisted-Python] transport.write performance.

2013-07-30 Thread Laurens Van Houtven
Hi zipxing, You don't mention the interpreter. Is it CPython? What kind of results do you get trying it on PyPy? Also, you don't need to specify epollreactor. Recent versions of twisted will automagically choose the appropriate backend. I fixed this and some other cleanups and got: from tim

Re: [Twisted-Python] ugh open-ssl and twisted python

2013-07-27 Thread Laurens Van Houtven
Hi Gary, On Sat, Jul 27, 2013 at 6:08 PM, gary clark wrote: > Hello, > > This problem has been driving me crazy for a couple of days. I'm hoping > someone can shed some light > on this. I have a twisted server its using open-ssl (using certificates) > and runs on linux and communicates great wit

Re: [Twisted-Python] Trial & the mock library

2013-07-25 Thread Laurens Van Houtven
In addition to what jml said, I wonder if it makes sense for TestCase to raise when the return value of a test method is something other than None or a Deferred... cheers lvh ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twisted

Re: [Twisted-Python] Don't Finalize Connection

2013-07-23 Thread Laurens Van Houtven
Hi, On Tue, Jul 23, 2013 at 1:16 PM, Phil Mayers wrote: > He means "FIN+PSH" in the TCP flags field. > Ah! That makes a lot more sense :) > Without knowing more details, it's impossible to know if the far end or > his code initiated the close, and if the latter, whether something was > directl

Re: [Twisted-Python] Don't Finalize Connection

2013-07-23 Thread Laurens Van Houtven
Hi Thomas, On Tue, Jul 23, 2013 at 4:15 AM, Thomas Hommers wrote: > It seems that after i send data with self.transport.write(data) the last > packet will be send with the "FP." flag, what seems to "Finalize" the > connection from this end. > I can't find any information on the "FP" flag in eith

Re: [Twisted-Python] Best way to trigger a future connection with data

2013-07-22 Thread Laurens Van Houtven
ch has methods like "join", "leave", "say", "message"... > Thanks for helping me out with this, Twisted is slowly starting to make > sense now. > > Cheers, > -Nick. > > > On 19/07/13 14:52, Laurens Van Houtven wrote: > > Hi Nick,

Re: [Twisted-Python] Best way to trigger a future connection with data

2013-07-19 Thread Laurens Van Houtven
Hi Nick, I was thinking something along these lines: https://gist.github.com/lvh/67c64042a2be06b7bf7a cheers lvh ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Re: [Twisted-Python] Best way to trigger a future connection with data

2013-07-19 Thread Laurens Van Houtven
Hi Nick, Okay, question and code review time. Why are source and destination arguments to the protocol? Can't they just access it on the factory? It seems that the factory initiates many connections with the same parameters. Is that true? Does it only ever make sense to use the factory to fire m

Re: [Twisted-Python] Best way to trigger a future connection with data

2013-07-19 Thread Laurens Van Houtven
On Fri, Jul 19, 2013 at 10:19 AM, Nick Johnson wrote: > Thanks lvh, > > I did have to override the buildProtocol method in the Factory but I > then set Protocol.factory to be equal to the Factory (ie, > myprotocol.factory=self). > You could (perhaps should) do this by calling ClientFactory.buildP

Re: [Twisted-Python] SQL ORM for Twisted & PostgreSQL?

2013-07-19 Thread Laurens Van Houtven
On Fri, Jul 19, 2013 at 9:06 AM, Hynek Schlawack wrote: > > How would you feel about packaging it up on PyPI so people can try it out > effortlessly? What do Apple’s licenses say about that? Yes, I’m > volunteering. > It seems it's released under the ASL2. I don't know if Apple prevents *its* emp

Re: [Twisted-Python] Best way to trigger a future connection with data

2013-07-18 Thread Laurens Van Houtven
Hi Nick, You're pretty much there already. Instantiate a ClientFactory that holds all the necessary state. By default, your protocol will have access to that state through its factory attribute (unless you override the Factory's buildProtocol method). cheers lvh __

[Twisted-Python] Twisted and new-style classes

2013-07-15 Thread Laurens Van Houtven
Hi! Maciej from the PyPy team has graciously offered to upgrade all of Twisted's existing old-style classes to new-style. The reason this is now also a mailing list thread is because it may, potentially, break some things, and we want people to have a heads up. Of course, Twisted will never break

Re: [Twisted-Python] “Unhandled Error” comes when TCP server tries to accept connections from client in twisted

2013-06-28 Thread Laurens Van Houtven
You forgot to set the protocol attribute of the factory. factory.protocol = ChatServer On Jun 28, 2013 10:05 PM, "jaspreet singh Kalsi" < jaspreetsingh4...@gmail.com> wrote: > from twisted.internet.protocol import Factory,Protocolfrom twisted.internet > import reactor > class ChatServer(Protocol

[Twisted-Python] How do you write a setup.py that installs plugins?

2013-06-28 Thread Laurens Van Houtven
Hi, How are you supposed to write a setup.py that installs twistd plugins? I have this piece of tribal knowledge: from setuptools.command import egg_info def _top_level(name): return name.split('.', 1)[0] def _hacked_write_toplevel_names(cmd, basename, filename): names = map(_top

Re: [Twisted-Python] If the errbacks of a canceled Deferred are called with error other than CancelledError, is this acceptable?

2013-06-18 Thread Laurens Van Houtven
On Tue, Jun 18, 2013 at 8:22 PM, Glyph wrote: > I would say that if we want to percolate this information up to the > caller, there should be a ConnectingCancelled exception that is a subtype > of the previous exception type. > Doesn't that mean we'll have many subclasses that mean that somethin

Re: [Twisted-Python] 13.1.0 and #6499

2013-06-15 Thread Laurens Van Houtven
This was resolved :) cheers lvh ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Re: [Twisted-Python] Difficulty restarting/shutting down a twisted server - ports not closing

2013-06-12 Thread Laurens Van Houtven
Hi Paul The documentation covers how to use Twisted with Tk (and many other event loops). Here's the link you want: https://twistedmatrix.com/documents/current/core/howto/choosing-reactor.html#auto16 Hope that helps :) lvh ___ Twisted-Python mailing lis

Re: [Twisted-Python] New registrations to this mailing list broken?

2013-05-28 Thread Laurens Van Houtven
Oops, just read that this is a know issue. My bad :) cheers lvh ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

  1   2   3   4   >