[Twisted-Python] Twisted meetup/discussion at EuroPython?

2009-04-01 Thread Terry Jones
I was thinking it would be nice to have a Twisted interest group meetup at
EuroPython (June 30 - July 2) http://www.europython.eu

Would people be interested in attending? Does someone more qualified want
to organize it? Are any Twisted developers planning to be at EuroPython?

The submissions page http://www.europython.eu/submission/ has a category
for Interest Group Meeting or Discussion. I'm thinking more along the lines
of the former - that it would be nice to be better connected to other
Twisted programmers in Europe, to put a face to some of the names on the
mailing list / IRC, etc.

Terry

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] Twistd and application framework questions

2009-04-01 Thread Nadav Aharony

Hello,

I have finally gotten to a stage where I want to run my very large 
application as a daemonized twisted app, and I have two questions:


1) The program uses multiple UDP/TCP clients and servers that are 
currently launched with reactor.listenTCP / UDP connectTCP/UDP etc. I've 
been using MultiService, according to the twisted documentation.
Some of these services were are at a top level of my app so it was easy 
to turn that part into a .tac file and switch the reacor calls to 
internet.TCPServer etc.
However, some of them are deep inside my code, and are instantiated on 
the fly.


What is the right way to attach them to my service parent? (the part 
with .setServiceParent(myMultiservice)
Should I now add a pointer to my MultiService that will be propagated 
down the  code hierarchy to each of these calls and be accessible at the 
inner scopes?
Is there a neater way to do it just with importing the right modules? 
(in the same way that in usual twisted scripts the loaded reactor is a 
global reactor)


2)  There are still scenarios where I would want to run my code the 
reactor way rather than than using the application framework, and I 
would love to be able to keep a single file that's compatible with both 
modes..
Is there a way to detect in runtime whether the code is being run 
through 'twistd' and the app framework or if its run directly?

I was thinking of doing something like:

if test if we are run as an app:
   internet.TCPServer(port,factory).setServiceParent(myMultiservice)
else:
   reactor.listenTCP(port,factory)


Thanks!
Nadav



___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Twisted meetup/discussion at EuroPython?

2009-04-01 Thread Esteve Fernàndez
 I was thinking it would be nice to have a Twisted interest group meetup at
 EuroPython (June 30 - July 2) http://www.europython.eu

 Would people be interested in attending? Does someone more qualified want
 to organize it? Are any Twisted developers planning to be at EuroPython?

I don't know, it all depends on whether my company will allow me to go
EuroPython :-) But I'm not qualified at all, I'm just a padawan Twisted dev,
Glyph forced^Wvolunteered me to become one at PyCon. Man, that guy is very
convincing :-)

 The submissions page http://www.europython.eu/submission/ has a category
 for Interest Group Meeting or Discussion. I'm thinking more along the lines
 of the former - that it would be nice to be better connected to other
 Twisted programmers in Europe, to put a face to some of the names on the
 mailing list / IRC, etc.

I'd definitely be interested in a meeting of Twisted programmers at
EuroPython, unfortunately I didn't meet any European Twisted programmers at
PyCon.

Cheers.


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Twistd and application framework questions

2009-04-01 Thread Rob Hoadley
I can help you with this question:

 2)  There are still scenarios where I would want to run my code the
 reactor way rather than than using the application framework, and I would
 love to be able to keep a single file that's compatible with both modes..
 Is there a way to detect in runtime whether the code is being run through
 'twistd' and the app framework or if its run directly?
 I was thinking of doing something like:


I'm sure there's a way to introspect and figure out how you are being
run. But...

Why do you want to do this?

If it's because you have different environments between prod and
development then you can look at twisted plugins or I just use ENV
vars from my os.environ.  When the app starts it pulls os.environ
vars.

If it's to debug? You can twistd -noy.

I'd also recommend that you are better off in the long run if you
create a number of unittests. trial offers a way to run unittests
within the reactor.  If you haven't done this step it's a major
lifesaver. Tests help you understand how your service,protocol,etc
react and gives you confidence to roll all your services code together
and have it just work.  I've even used trial to do all kinds of crazy
stuff  in my normal non-twisted python coding. Also buildbot to
automatically run the tests is handy.

If it's to run just one service? You'd add this to the bottom of your
service file (i'm assuming you've separated your service from your tac
file)

if __name__ == __main__:
#start your service/services here

the tac file won't execute main when importing the service.  So it's
not two files.  But I'm not sure what your end goal is here.  Do tell.

-rob

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] official packaging

2009-04-01 Thread Tim Allen
Esteve Fernandez est...@sindominio.net wrote:
 Anyway, it would be great to have recent packages of Twisted for 
 distributions 
 that offer some kind of long term support contracts (Ubuntu, RHEL, etc.), but 
 that tend to get a bit outdated.

It's worth mentioning that someone has recently stepped up to fix
ticket 1696 after I'd ignored it for Far Too Long, and very soon it
should be possible to build Twisted RPMs for RHEL just by running
./setup.py bdist_rpm in a fresh checkout.

For Debian-based distros, I hear there's a tool called debhelper that
apparently has some useful tricks for making .deb packages from a
distutils setup.py; I'm not sure how it interacts with or without
python-central, and I don't know how well it would deal with Twisted's
rather... customised setup.py.


signature.asc
Description: PGP signature
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python