[Twisted-Python] question about twisted conch (SSH) and wxPython

Astan Chee stanc at al.com.au
Mon Jul 18 19:37:14 EDT 2005


Thanks for the help.
Another thing I was wondering about is if any of the twisted components 
supports rsh? or is just using the` rsh` command easiest?
Also where can I find detailed documentation on twisted classes and its 
method? or is diving into the code my best way?
thanks again
Cheers

Phil Mayers wrote:

> Astan Chee wrote:
>
>> def getPassword(self):
>>        global RETRIES
>>        if RETRIES  == 0:
>>            RETRIES = 1
>>            return defer.succeed(PASSWORD)
>>        else:                      sys.exit(0)
>>
>> But it keeps on giving this error:
>
> Yes, that's what sys.exit does, raise a SystemExit exception.
>
> If you actually want a non-zero exit status, you need to reactor.stop 
> and save your exit status somewhere, e.g.
>
> exitstatus=0
>
> def thing():
>     global exitstatus
>     if fail:
>         exitstatus = 1
>     reactor.stop()
>
> reactor.run()
> # We'll only get here once reactor.stop is called
> sys.exit(exitstatus)
>
> A trivial bit of thought can solve this more elegantly than a global 
> (gak!)
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>




More information about the Twisted-Python mailing list