[Twisted-Python] Correct pattern to do SSH forwarding in a GUI

2009-02-16 Thread Luper Rouch
I am using twisted in a GUI application to do port forwarding over an SSH connection. All the network connections of the application (database, etc...) are routed through this connection, to simplify server configuration and secure things. My first attempt was to run the reactor in the main th

Re: [Twisted-Python] Correct pattern to do SSH forwarding in a GUI

2009-02-17 Thread Luper Rouch
gl...@divmod.com wrote: On 04:19 am, luper.ro...@gmail.com wrote: My first attempt was to run the reactor in the main thread, but the application was "freezing" when e.g. doing a SELECT with SQLAlchemy/psycopg2 (I guess because psycopg2 just waits for data and blocks the twisted reactor). So I

[Twisted-Python] KeyError when an errback is triggered within a conch TCP tunnel

2009-02-18 Thread Luper Rouch
Sorry I have not been able to find a better title, please see the attached example which may be more descriptive. Here is what it does: * set up an SSH connection * open a TCP forwarding channel through this connection * do something through the tunnel that will trigger an errback (in the

[Twisted-Python] KeyError when an errback is triggered within a conch TCP tunnel

2009-02-18 Thread Luper Rouch
(posting it a second time with the example code inlined as pipermail did not like the attachment) Sorry I have not been able to find a better title, please see the attached example which may be more descriptive. Here is what it does: * set up an SSH connection * open a TCP forwarding channe

[Twisted-Python] Debugging Twisted

2009-02-20 Thread Luper Rouch
I would like to investigate on the conch error I mentionned in my previous message ("KeyError when an errback is triggered within a conch TCP tunnel"). My problem is Twisted catches the exceptions and the debugger won't stop on them, how could I avoid that ? Is there a "debug" reactor ?

Re: [Twisted-Python] Debugging Twisted

2009-02-20 Thread Luper Rouch
Jean-Paul Calderone wrote : On Fri, 20 Feb 2009 19:56:54 +0100, Luper Rouch wrote: I would like to investigate on the conch error I mentionned in my previous message ("KeyError when an errback is triggered within a conch TCP tunnel"). My problem is Twisted catches the exceptio

Re: [Twisted-Python] Debugging Twisted

2009-02-23 Thread Luper Rouch
Jean-Paul Calderone a écrit : On Fri, 20 Feb 2009 20:15:02 +0100, Luper Rouch wrote: Jean-Paul Calderone wrote : On Fri, 20 Feb 2009 19:56:54 +0100, Luper Rouch wrote: I would like to investigate on the conch error I mentionned in my previous message ("KeyError when an errback is trig

[Twisted-Python] Re: KeyError when an errback is triggered within a conch TCP tunnel

2009-02-23 Thread luper rouch
Running the example in the debugger, neither ssh_CHANNEL_OPEN() nor ssh_CHANNEL_OPEN_CONFIRMATION() method of twisted.conch.ssh.connection.SSHConnection is called, so self.channelsToRemoteChannel dict is empty when sendClose() is called, thus the error. I am not sure if I should file a bug as I'm

Re: [Twisted-Python] Debugging Twisted

2009-02-23 Thread luper rouch
2009/2/23 Jean-Paul Calderone : > On Mon, 23 Feb 2009 15:11:15 +0100, Luper Rouch > wrote: >> >> Jean-Paul Calderone a écrit : >>> >>> On Fri, 20 Feb 2009 20:15:02 +0100, Luper Rouch >>> wrote: >>>> >>>> Jean-Paul Calderon

Re: [Twisted-Python] Using sqlalchemy in twisted.

2009-03-10 Thread luper rouch
I would recommend sandboxing Twisted code in another process when used in conjunction with synchronous code (sqlalchemy, GUI, etc...). This proved quite simple in my project, using the multiprocessing module [1], and avoided me lots of headaches since. This way I don't mix coding styles everywhere

Re: [Twisted-Python] Using sqlalchemy in twisted.

2009-03-13 Thread luper rouch
2009/3/12 Peter Cai : > Hi, > I've read some mails in this list that recommend use sqlalchemy in separate > processes. > But if u use multiprocessing which provides only synchronous API, doesn't > you have to use deferToThread also? > Another way would be using "twisted.internet.protocol.ProcessPro

[Twisted-Python] Plugin startup and shutdown actions

2009-04-10 Thread luper rouch
I would like to port my Application API based services to the twistd plugin interface, to be able to retrieve command line options. In the existing services, I reimplemented t.a.s.MultiService startService() and stopService() to do some actions at startup and shutdown. How can I do this in a plug

Re: [Twisted-Python] Plugin startup and shutdown actions

2009-04-11 Thread luper rouch
2009/4/11 Jean-Paul Calderone : > On Sat, 11 Apr 2009 00:24:37 +0200, luper rouch > wrote: >> >> I would like to port my Application API based services to the twistd >> plugin interface, to be able to retrieve command line options. >> >> In th

Re: [Twisted-Python] Plugin startup and shutdown actions

2009-04-11 Thread luper rouch
2009/4/11 Esteve Fernandez : > On Saturday 11 April 2009 19:42:31 Jean-Paul Calderone wrote: >> They can be imported from "twisted.plugins".  For example, if you name your >> "dropin" file foo_plugins.py, then "from twisted.plugins import >> foo_plugins" should work and let you test any code that i