twisted

Can't import my module when start my twisted application under root

Here is absolutely minimal application so you could try to reproduce it on your machine. Having two files for example in /home/aln/tmp/tw_test: server.tac MyLib.py MyLib.py class Solver(object): def solve(self): """ do extremely complex stuff here """ print "Hello from solve" server.tac #!/usr/bin/python impor...

python library for file upload and persistent connections?

Hi, I tried urllib{2}, pycurl and I'm looking at twisted's new http client. But: I found urllib2 difficult to perform a file upload pycurl multi looks right but unpythonic twisted's http client does not support persistent connection (didn't check the file upload capability) Is there any other alternative? ...

unbound python method, potentially scope issue

Hi, I'm using iPython right now to interactively set up a Twisted network. The script that I run in iPython describes best of what I have to do: import router, pdb # creates nodes which encapsulate RandomVector and VectorAdder objects a = router.LocalNode(router.RandomVector, '/topic/a_c') b = router.LocalNode(router.RandomVector, '/t...

Is there some good Twisted cheat sheets or reference cards?

I'm recently started to learn Twisted framework and now looking for some cheat sheets/reference cards with basic Twisted stuff. Such as deferreds, callbacks, reactor, protocols, factories, transports, so on. At the moment found nothing neither on http://refcardz.dzone.com/ nor on http://www.cheat-sheets.org/ Any help appreciated. ...

Python twisted Reactor class

What is the significance of the decorators @reactor.callWhenRunning, @results_deferred.addCallback @results_deferred.addErrback. Also what are deferred strings, for example in the twisted.internet.utils.getProcessOutput() returns a deferred string what exactly is happening here? I am new to twisted hence this might be a very ...

How to control a subthread process in python?

Code first: '''this is main structure of my program''' from twisted.web import http from twisted.protocols import basic import threading threadstop = False #thread trigger,to be done class MyThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.start() def run(self): whi...

What is the Lua equivalent of Twisted Python, Eventmachine for Ruby, NIO for Java, etc.?

What is the Lua equivalent of Twisted Python, Eventmachine for Ruby, NIO for Java, etc.? If there is none, how does one do non-blocking event-based network I/O? In general, how does one solve the C10K problem in Lua? Thanks! ...

developing a chat website

I want to develop a anonimous chat website like omgele.com.I know that this website is devloped in python using twisted matrix framework.Using twsited matrix its easy to devlop such website. But i am very comfortable in java and have 1 yr expericne in it.and dont know python. What shold i do? Should i start learning python to take a...

Twisted: why is it that passing a deferred callback to a deferred thread makes the thread blocking all of a sudden?

I unsuccessfully tried using txredis (the non blocking twisted api for redis) for a persisting message queue I'm trying to set up with a scrapy project I am working on. I found that although the client was not blocking, it became much slower than it could have been because what should have been one event in the reactor loop was split up ...

Python (Twisted) - reading from fifo and sending read data to multiple protocols

Hi, Im trying to write some kind of multi protocol bot (jabber/irc) that would read messages from fifo file (one liners mostly) and then send them to irc channel and jabber contacts. So far, I managed to create two factories to connect to jabber and irc, and they seem to be working. However, I've problem with reading the fifo file - I...

Start Python from Twisted

Hi all, I have learnt Python for about a month as a one year's PHPer.And I started from Twisted as I'm working in a corporation supplying webservice.I have finished some simple application such as data transferring service,page images-fetch service etc.But the problem is ,I don't understand the struture of codes I wrote in the programs ...

How to make Twisted use Python logging?

I've got a project where I'm using Twisted for my web server. When exceptions occur (such as network errors), it's printing to the console. I've already got logging through Python's built-in log module - is there any way to tell the reactor to use that instead? What's the usual pattern for this? ...

How to step through debug twisted?

I'd like to be able to debug Punjab, a twisted python application, in Netbeans so that I can step through the code. How can I do that? Alternatively, how could I do it in a different debugger? ...

Twisted - how to create multi protocol process and send the data between the protocols

Hey, Im trying to write a program that would be listening for data (simple text messages) on some port (say tcp 6666) and then pass them to one or more different protocols - irc, xmpp and so on. I've tried many approaches and digged the Internet, but I cant find easy and working solution for such task. The code I am currently fighting ...

Difference from Twisted and Tornado ?

Hi at all, I need to create a simple browser chat using a Comet webserver. So I have found Twisted and Tornado. What is the difference ? ...

Simple non-network concurrency with Twisted

Dear pythoners, I have a problem with using Twisted for simple concurrency in python. The problem is - I don't know how to do it and all online resources are about Twisted networking abilities. So I am turning to SO-gurus for some guidance. Python 2.5 is used. Simplified version of my problem runs as follows: A bunch of scientific d...

stop ReconnectingClientFactory (XmlStreamFactory)

Hey guys, I tried to write a XMPP Client using this mentioned factories. Now my program only needs this connection during a short time. How can I make the Factory to stop reconnection attempts? Unfortunately stopTrying doesn't work. Do I have to disconnect running connections before? Any help would be appreciated :) ...

Annoying Twisted Python problem

I'm trying to answer the following question out of personal interest: What is the fastest way to send 100,000 HTTP requests in Python? And this is what I have came up so far, but I'm experiencing something very stange. When installSignalHandlers is True, it just hangs. I can see that the DelayedCall instances are in reactor._newTimedCa...

Sending data from one Protocol to another Protocol in Twisted?

Hi! One of my protocols is connected to a server, and with the output of that I'd like to send it to the other protocol. I need to access the 'msg' method in ClassA from ClassB but I keep getting: exceptions.AttributeError: 'NoneType' object has no attribute 'write' Actual code: from twisted.words.protocols import irc from twisted.i...

Python: How can I use Twisted as the transport for SUDS?

I have a project that is based on Twisted used to communicate with network devices and I am adding support for a new vendor (Citrix NetScaler) whose API is SOAP. Unfortunately the support for SOAP in Twisted still relies on SOAPpy, which is badly out of date. In fact as of this question (I just checked), twisted.web.soap itself hasn't e...