[Twisted-Python] Using Twisted and GTK2
Hi everybody, I recently new about Twisted and saw it as the best way to deal with a client/server network application (I use python long time ago). Really wonderful. I now intend to write a GTK client that can send commands and transfers files to the server and from it. I started to learn how to write applications not using 'Perspective Broker', but when I reached to the example pbgtk2.py to authenticate and send echo commands, I could no see a way the same with a PB. Is that true?. Is, anyway the best alternative (I mean PB) to write the application I intend to? Thanks in advance Regards -- Ramiro Alba Centre Tecnològic de Tranferència de Calor http://www.cttc.upc.edu Escola Tècnica Superior d'Enginyeries Industrial i Aeronàutica de Terrassa Colom 11, E-08222, Terrassa, Barcelona, Spain Tel: (+34) 93 739 86 46 -- Aquest missatge ha estat analitzat per MailScanner a la cerca de virus i d'altres continguts perillosos, i es considera que està net.
Hi,
|--==> On Wed, 03 Feb 2010 13:48:39 +0100, Ramiro Alba Queipo
Free, Really interesting. I did not realized, but I do not know if it is too simple as, I want to use a SQL Database authentication an a view from a web client. On Wed, 2010-02-03 at 15:28 +0100, Free Ekanayaka wrote:
Hi,
|--==> On Wed, 03 Feb 2010 13:48:39 +0100, Ramiro Alba Queipo
said: RAQ> Hi everybody, RAQ> I recently new about Twisted and saw it as the best way to deal with a RAQ> client/server network application (I use python long time ago). Really RAQ> wonderful. I now intend to write a GTK client that can send commands and RAQ> transfers files to the server and from it. RAQ> I started to learn how to write applications not using 'Perspective RAQ> Broker', but when I reached to the example pbgtk2.py to authenticate and RAQ> send echo commands, I could no see a way the same with a PB. Is that RAQ> true?. Is, anyway the best alternative (I mean PB) to write the RAQ> application I intend to?
If you don't need all the features of PB and something simpler is enough, you might want to consider AMP:
http://twistedmatrix.com/documents/9.0.0/api/twisted.protocols.amp.html
Cheers,
Free
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-- Ramiro Alba Centre Tecnològic de Tranferència de Calor http://www.cttc.upc.edu Escola Tècnica Superior d'Enginyeries Industrial i Aeronàutica de Terrassa Colom 11, E-08222, Terrassa, Barcelona, Spain Tel: (+34) 93 739 86 46 -- Aquest missatge ha estat analitzat per MailScanner a la cerca de virus i d'altres continguts perillosos, i es considera que està net.
On 2010.02.03 13:48:39 +0100, Ramiro Alba Queipo wrote:
I recently new about Twisted and saw it as the best way to deal with a client/server network application (I use python long time ago). Really wonderful. I now intend to write a GTK client that can send commands and transfers files to the server and from it. I started to learn how to write applications not using 'Perspective Broker', but when I reached to the example pbgtk2.py to authenticate and send echo commands, I could no see a way the same with a PB. Is that true?. Is, anyway the best alternative (I mean PB) to write the application I intend to?
PB is fine. AMP or Foolscap might be better for some tasks, but PB is mature and works. PB features integration with Cred, which is Twisted's pluggable authentication mechanism. http://twistedmatrix.com/documents/current/core/howto/cred.html Cred is very flexible. The integration between PB and Cred isn't quite as flexible, but it works fine for straightforward cases. If you're looking for larger sample code, I have a game that uses PyGTK and PB and Cred, here: http://github.com/dripton/Slugathon -- David Ripton dripton@ripton.net
Thanks David. I'll take a look on your code Regards On Wed, 2010-02-03 at 11:03 -0800, David Ripton wrote:
On 2010.02.03 13:48:39 +0100, Ramiro Alba Queipo wrote:
I recently new about Twisted and saw it as the best way to deal with a client/server network application (I use python long time ago). Really wonderful. I now intend to write a GTK client that can send commands and transfers files to the server and from it. I started to learn how to write applications not using 'Perspective Broker', but when I reached to the example pbgtk2.py to authenticate and send echo commands, I could no see a way the same with a PB. Is that true?. Is, anyway the best alternative (I mean PB) to write the application I intend to?
PB is fine. AMP or Foolscap might be better for some tasks, but PB is mature and works.
PB features integration with Cred, which is Twisted's pluggable authentication mechanism.
http://twistedmatrix.com/documents/current/core/howto/cred.html
Cred is very flexible. The integration between PB and Cred isn't quite as flexible, but it works fine for straightforward cases.
If you're looking for larger sample code, I have a game that uses PyGTK and PB and Cred, here:
http://github.com/dripton/Slugathon
-- David Ripton dripton@ripton.net
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-- Ramiro Alba Centre Tecnològic de Tranferència de Calor http://www.cttc.upc.edu Escola Tècnica Superior d'Enginyeries Industrial i Aeronàutica de Terrassa Colom 11, E-08222, Terrassa, Barcelona, Spain Tel: (+34) 93 739 86 46 -- Aquest missatge ha estat analitzat per MailScanner a la cerca de virus i d'altres continguts perillosos, i es considera que està net.
Hello everyone,
Though, as far as I know, PB is not transfered in clear text. That
means it's a little harder to debug the TCP streams, using a tool like
Wireshark. Am I wrong?
a
2010/2/4 Ramiro Alba Queipo
Thanks David. I'll take a look on your code
Regards
On Wed, 2010-02-03 at 11:03 -0800, David Ripton wrote:
On 2010.02.03 13:48:39 +0100, Ramiro Alba Queipo wrote:
I recently new about Twisted and saw it as the best way to deal with a client/server network application (I use python long time ago). Really wonderful. I now intend to write a GTK client that can send commands and transfers files to the server and from it. I started to learn how to write applications not using 'Perspective Broker', but when I reached to the example pbgtk2.py to authenticate and send echo commands, I could no see a way the same with a PB. Is that true?. Is, anyway the best alternative (I mean PB) to write the application I intend to?
PB is fine. AMP or Foolscap might be better for some tasks, but PB is mature and works.
PB features integration with Cred, which is Twisted's pluggable authentication mechanism.
http://twistedmatrix.com/documents/current/core/howto/cred.html
Cred is very flexible. The integration between PB and Cred isn't quite as flexible, but it works fine for straightforward cases.
If you're looking for larger sample code, I have a game that uses PyGTK and PB and Cred, here:
http://github.com/dripton/Slugathon
-- David Ripton dripton@ripton.net
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-- Ramiro Alba
Centre Tecnològic de Tranferència de Calor http://www.cttc.upc.edu
Escola Tècnica Superior d'Enginyeries Industrial i Aeronàutica de Terrassa Colom 11, E-08222, Terrassa, Barcelona, Spain Tel: (+34) 93 739 86 46
-- Aquest missatge ha estat analitzat per MailScanner a la cerca de virus i d'altres continguts perillosos, i es considera que està net.
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-- Alexandre Quessy http://alexandre.quessy.net/
On 2010.02.04 08:23:20 -0500, Alexandre Quessy wrote:
Though, as far as I know, PB is not transfered in clear text. That means it's a little harder to debug the TCP streams, using a tool like Wireshark. Am I wrong?
The PB wire format is documented here: http://twistedmatrix.com/documents/9.0.0/api/twisted.spread.jelly.html It's human-readable S-expressions. -- David Ripton dripton@ripton.net
On 03:02 pm, dripton@ripton.net wrote:
On 2010.02.04 08:23:20 -0500, Alexandre Quessy wrote:
Though, as far as I know, PB is not transfered in clear text. That means it's a little harder to debug the TCP streams, using a tool like Wireshark. Am I wrong?
The PB wire format is documented here: http://twistedmatrix.com/documents/9.0.0/api/twisted.spread.jelly.html
It's human-readable S-expressions.
Well, sort of... Jelly is the first stage of processing, but the output is lists of simple Python objects, which you can't put into a socket. So banana is the next stage of processing, which converts the output of jelly into bytes. It's fair to say that banana is not human readable. Just speaking from personal experience, I've never wanted to get wireshark (or similar tools) involved to debug a PB-using applications. As an application the developer, the problems encountered when using PB are things that are more easily debugged with pdb, unit tests, or inserting logging at a higher level (such as the PB message dispatch code). Banana works. Jelly works. It's very uncommon for them to get in your way. Jean-Paul
participants (5)
-
Alexandre Quessy
-
David Ripton
-
exarkun@twistedmatrix.com
-
Free Ekanayaka
-
Ramiro Alba Queipo