[Twisted-Python] Plugin Example - review appreciated

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Tue Jun 21 17:32:11 EDT 2011


On 04:17 pm, stephen at thorne.id.au wrote:
>G'day,
>
>Here at europython there was an excellent tutorial given on the first
>afternoon that was so well attended and regarded that a repeat is
>being done tomorrow afternoon (24 hours from this posting).
>
>I was asked by the person running the training to give him a hand
>because it's quite tiring doing a multi-hour training twice in a week,
>and he specifically mentioned that it would be nice to have an example
>of best practice with regard to making a working twisted program into
>a 'production ready' deployable piece of code.
>
>So I wrote this example which is a skeleton of how to set up a twistd
>plugin and how to invoke it:
>
>https://bitbucket.org/jerub/twisted-plugin-example
>
>I would appreciate any comments, patches or criticisms between now and
>tomorrow. (hg email anything to my address, stephen at thorne.id.au, fork
>and push to bitbucket, or just email the list to yell at me).

Unit tests.

Docstrings.

Don't define Options or makeService in the dropin file.

Unit tests.

Use twisted.application.service.ServiceMaker instead of implementing 
your own.

Unit tests.

Docstrings.

It's not "strports" anymore.  It's "string endpoint descriptions" or 
just "endpoints".  You are using the right API but you named all the 
options and variables wrong.

Unit tests.

Don't use the global reactor in SetupService.

Unit tests.

Docstrings.
>Thanks!
>Stephen.
>
>_______________________________________________
>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