[Twisted-Python] help with listening to UDP broadcast?

2014-08-08 Thread Russell E. Owen
I've found an example for UDP broadcasting: However, it combines the sender and receiver in a way that I find confusing. I figured out how output UDP broadcast packets, but not how to make a cli

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

2014-03-13 Thread Russell E. Owen
In article , Laurens Van Houtven <_...@lvh.io> wrote: > 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

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

2014-03-13 Thread Russell E. Owen
Is there a simple way to cancel all Twisted timers (pending reactor.callLater calls)? The reason I want to do this is to clean up a unit test without getting "dirty reactor" complaints. The system is a server that will rarely be shut down and does not have to shut down gracefully (i.e. I don'

[Twisted-Python] Defer until a server is ready?

2013-10-21 Thread Russell E. Owen
For unit testing and other reasons I would like to launch a server in a subprocess, then wait until it is available before running some code that uses it. Is there a standard paradigm for this, e.g. poll until a connection is accepted, or have the server emit some kind of "ready" signal (such a

Re: [Twisted-Python] Running unit tests without trial?

2013-09-25 Thread Russell E. Owen
In article <20130925184544.26068.1404349410.divmod.xquotient.2424@top>, exar...@twistedmatrix.com wrote: > On 06:15 pm, ro...@uw.edu wrote: > >Is it possible to run twisted.trial unit tests using python instead of > >trial, i.e.: "python mytest.py" instead of "trial mytest.py"? > > Sure. Here'

[Twisted-Python] Running unit tests without trial?

2013-09-25 Thread Russell E. Owen
Is it possible to run twisted.trial unit tests using python instead of trial, i.e.: "python mytest.py" instead of "trial mytest.py"? I'm hoping there is some simple magic I can put into the unit test itself to make this work. Perhaps something in if __name__ == "__main__": ...? to make it st

Re: [Twisted-Python] unit testing question: twisted with tk

2012-07-18 Thread Russell E. Owen
In article <5006fc68.8050...@itamarst.org>, Itamar Turner-Trauring wrote: > On 07/18/2012 01:01 PM, Russell E. Owen wrote: > > I have a bit of code that combines twisted with Tkinter > > and now I'd like to write some unittests for it. > > > > I can't

Re: [Twisted-Python] A few simple questions

2012-07-18 Thread Russell E. Owen
In article , Glyph wrote: > On Jul 17, 2012, at 9:25 AM, Russell E. Owen wrote: > > >> Can you elaborate on the case? > > > > I've found that Twisted sometimes swallows errors unless I am extremely > > careful. I would like to be able to check a protoc

[Twisted-Python] unit testing question: twisted with tk

2012-07-18 Thread Russell E. Owen
I have a bit of code that combines twisted with Tkinter and now I'd like to write some unittests for it. I can't seem to figure out how to get TwistedTrial to handle this case. I've written a unit test like this: from twisted.trial import unittest from twisted.internet.defer import Deferred impo

Re: [Twisted-Python] A few simple questions

2012-07-17 Thread Russell E. Owen
In article , Laurens Van Houtven <_...@lvh.cc> wrote: > On Thursday, July 12, 2012, Russell E. Owen wrote: > > > I'm adding Twisted support to some existing communication code and I > > have a few questions which I hope are simple. I've been reading the

[Twisted-Python] A few simple questions

2012-07-12 Thread Russell E. Owen
I'm adding Twisted support to some existing communication code and I have a few questions which I hope are simple. I've been reading the API documentation, but if the answers are there I'm missing them. What happens if one tries to write to a protocol.transport that is not connected or in an er

Re: [Twisted-Python] Python 2.6 with twisted on OSX

2010-12-23 Thread Russell E. Owen
In article , Eric Dennison wrote: > I am planning to teach a Python/Pygame workshop in which students will be > (mostly) using Apple hardware and OSX in various flavors. The installation > of Python 2.6 and Pygame runs smoothly but I hit a wall when trying to > download/install Twisted because

[Twisted-Python] Re: Can't quit a Tkinter application on MacOS X when using Twisted; fix? workaround?

2009-04-15 Thread Russell E. Owen
In article <20090413211444.24697.1739128157.divmod.quotient.7...@henry.divmod.com>, Jean-Paul Calderone wrote: >... > It sounds like we should expand the Tk documentation to include the solution > you found, in case someone else without a closeable root window wants to use > Twisted with Tkinte

[Twisted-Python] Re: Can't quit a Tkinter application on MacOS X when using Twisted; fix? workaround?

2009-04-13 Thread Russell E. Owen
In article <20090410160133.24697.1558421192.divmod.quotient.5...@henry.divmod.com>, Jean-Paul Calderone wrote: > On Tue, 07 Apr 2009 12:20:50 -0700, "Russell E. Owen" > wrote: > >I am trying to convert a cross-platform Python/Tkinter application to > >use T

[Twisted-Python] Re: Can't quit a Tkinter application on MacOS X when using Twisted; fix? workaround?

2009-04-08 Thread Russell E. Owen
In article , "Russell E. Owen" wrote: > I am trying to convert a cross-platform Python/Tkinter application to > use Twisted and have run into a problem: at least on MacOS X I can no > longer quit the application. > > """Script showing failure-to

[Twisted-Python] Can't quit a Tkinter application on MacOS X when using Twisted; fix? workaround?

2009-04-07 Thread Russell E. Owen
I am trying to convert a cross-platform Python/Tkinter application to use Twisted and have run into a problem: at least on MacOS X I can no longer quit the application. I have appended a minimal script showing the problem. This is probably not an issue on unix and WIndows because I find I have