twisted

Function Names for sending and receiving RPCs?

I'm using twisted. I have my protocols set up so that, to send an RPC, I do protocol.send("update_status", data). To document which RPCs I've implemented, I make a separate function call for each one, so in this case I'd call REQUEST_UPDATE_STATUS(data) to send that RPC. When a protocol receives an RPC, a function gets called based on it...

python+twisted+gtk: KeyboardInterrupt causes free variable?

I'm using twisted with GTK, and the following code runs when a connection could not be established: def connectionFailed(self, reason): #show a "connect failed" dialog dlg = gtk.MessageDialog( type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_CLOSE, message_format="Could not connect to server:\n%s" % ( ...

django with twisted web - wgi and vhost.

I have a project which has a directory setup like: myproject someapp sites foo settings.py - site specific settings.py - global I am using twisted web.wsgi to serve this project. The problem am I running into is setting up the correct environment. import sys import os from twisted.application import internet, s...

developing a scalabe chat system.

I am a java developer and am pretty comfortable with develeoping webapps in java/jsp/servlets. I want to develop a video web based chat website.people should be able to chat with each other using my website.People dont need to use any client app installed on their pc in order to chat with others. My website should be scalable.It should...

wxPython and py2app, CreateActCtx error 0x00000008 (Not enough disk space available)

I've been developing an application that uses wxPython as the GUI librar, and py2exe so that I can easily distribute it, however I have just now tested py2exe and the following error appears when the executable is launched. 12:13:08: Debug: src/helpers.cpp(140): 'CreateActCtx' failed with error 0x00000008 (Not enough disk space availabl...

Twisted transport.write

Is there any way to force self.transport.write(response) to write immediately to its connection so that the next call to self.transport.write(response) does not get buffered into the same call. We have a client with legacy software we cannot amend, that reads for the 1st request and then starts reading again, and the problem I have is...

simple twisted receiver for orbited comet server

I have an unusual request. I've just moved to a new apartment and I won't have my internet hooked up for over a week. I'm trying to develop my application using my phone for online documentation. Before I moved I found this video (vodpod.com/watch/4071950-building-real-time-network-applications-for-the-web-with-twisted-and-orbited-part-...

Would twisted be a good choice for building a multi-threaded server?

I need to pull from hundreds of pop3 email accounts, and i want to build a robust server to do this. Would twisted be a good choice for this type of project? Right now a simple prototype would be to pull from a single pop3 account, then it would pull from many but it would be a serialized process. I want to create a server that has mu...

UDP client and server with Twisted Python

I want to create a server and client that sends and receives UDP packets from the network using Twisted. I've already written this with sockets in Python, but want to take advantage of Twisted's callback and threading features. However, I need help though with the design of Twisted. I have multiple types of packets I want to receive, b...

Python Twisted: "wait" for a variable to be filled by another event

Hi Guys! I know that twisted will not "wait"... I am working with an XMPP client to exchange data with an external process. I send an request and need to fetch the corresponding answer. I use a sendMessage to send my request to the server. When the server answers a onMessage method will receive it and check if it an answer to a request ...

[python] socket.error errno.EWOULDBLOCK

i'm reading some code and i've come across this line socket.error errno.EWOULDBLOCK can anyone tell me what the conditions have to be to raise this error? ...

Getting Orbited to work with my Twisted app

I can't seem to get Orbited working with my Twisted app. I have a page, served by Twisted (say localhost:8000/page) which includes Orbited.js from the orbited server (localhost:8001/static/Orbited.js). I then have a TCP chat server example running on port 7777. I try to use Orbited.TCPSocket to connect to the chat server: conn=new Orbit...

Twisted and connection to MSSQL-Server

I have a Twisted application that runs in an x86 64bit machine with Win 2008 server. It needs to be connected to an MSSQL-Server database that runs in another machine (in a cloud actually but I have IP, port, db name, credentials). Do I need to install anything more that Twisted to my machine? And which API should be used? ...

Separating URL from http request

I am studying Python language. I want to know about splitting HTTP request GET /en/html/dummy.php?name=MyName&married=not+single &male=yes HTTP/1.1 Host: www.explainth.at User-Agent: Mozilla/5.0 (Windows;en-GB; rv:1.8.0.11) Gecko/20070312 Firefox/1.5.0.11 Accept: text/xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Lang...

Whatever data is input to the server the server have to respond back with the http URL with/without http:// if its a valid HTTP request

Whatever data is input to the server, either via telnet(console) or browser, the server have to respond back with the http URL with/without http:// if its a valid HTTP request . What has to be done? INPUT GET /learn/tutorials/351079-weekend-project-secure-your-system-with-port-knocking?name=MyName&married=not+single&male=yes HTTP/1.1 ...

Twisted's Serialport and disappearing serial port devices

Hi, I'm using twisted.internet.serialport to have my program be continuously connected to a device on a serial port. Unfortunately my serial port is just a usb device, which means it can be disconnected or reset by the OS at any time (port 2 disabled by hub (EMI?), re-enabling... ). I see that pyserial has support for this for a few we...

twisted: difference between `defer.execute` and `threads.deferToThread`

What is the difference between defer.execute() and threads.deferToThread() in twisted? Both take the same arguments - a function, and parameters to call it with - and return a deferred which will be fired with the result of calling the function. The threads version explicitly states that it will be run in a thread. However, if the defe...

How to format twisted logs?

Using the framework Twisted, when you use startLogging(), you get logging lines like: Y-M-D H-m-s [Class - IP] message How can I format that output in order to eliminate the date and the IP? Thanks ...

twisted IRCClient with a listentcp

I'm trying to make a simple IRC bot that also listens to another port for incoming data and relays that to an IRC channel.. I'm using the following as sample code for my bot http://www.eflorenzano.com/blog/post/writing-markov-chain-irc-bot-twisted-and-python/ I'm getting stuck how I also add a listenTCP to be able to talk to the bot wi...

Google App Engine to Twisted

I was about to migrate the GAE-OpenSocial project to Twisted Matrix and Nevow. I am very new to Nevow templating and couldn't find good documentation other than given in Divmod's Nevow Project page. Is there any books relating to Nevow? I am having trouble serving static files in Nevow. For app engine its easy to define static files in a...