hi there, folks:
I'd really like to release 0.7.0 but I would like it to be at least a
little bit tested before I do so. Could those of you with CVS trees check
everything out and see if it performs as advertised? Deeper bugs than
that will have to wait for the next release, but I'd at least like to know
if it works for someone other than me.
______ __ __ _____ _ _
| ____ | \_/ |_____] |_____|
|_____| |_____ | | | |
@ t w i s t e d m a t r i x . c o m
Dear Twisted developers,
I have started converting Thinking Like a Computer Scientist in Python
to Lore, to try and see what Lore is missing. It has been a most education
experience. The two prime things Lore is currently missing for lossless
conversion (of the specific chapter I tested) are:
* EPS images support
* Indexing support
However, beyond that, I am interested to know which looks better:
(The Lore is using the Twisted documentation stylesheet.)
Any comments would be nice. Comments which come with a patch to the
stylesheet will be doubly appreciated.
Thanks in advance,
Moshe Zadka -- http://moshez.org/
Buffy: I don't like you hanging out with someone that... short.
Riley: Yeah, a lot of young people nowadays are experimenting with shortness.
I am currently designing a code-deploying service, to be used in conjunction
with a variety of source control tools. I'm looking to use Twisted in the
implementation of the file-transfer mechanism, as Twisted's broad protocol
support would make it easy for me to switch from say, FTP to HTTP, or to some
custom protocol I roll myself.
I've experimented with twisted.protocols.ftp.FTPClient, and the one thing I
can't seem to grok is how to perform file uploads. I've read through the
code, and it seems that the FTP server class supports RETR and STOR, using
DTPFactory, while FTPClient only supports RETR, and implements it
Basically, I'm lost as to how to connect FTPClient to DTPFactory, such that I
can send files from FTPClient. I just need some pointers on how to accomplish
this; it seems like the code is there to do it, but I'm missing the necessary
Twisted mindset in this case.
Thanks for your help.
L. Daniel Burr
for those interested, I just posted a recipe on the activestate.com python
cookbook about how to get wxPython running with Twisted withoud having
blocked menu's and modal dialogs.
It's a simple and dirty hack, but it's working on linux and win (basically all
systems using the default select reactor)
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417
Here's my win32guireactor code, which at least for me, works better
than win32eventreactor in my application.
I have some problems in my app when using win32eventreactor:
If the app displays a message box, no callLater calls are done
(because a win32 messagebox has it's own event loop, and doIteration()
is not called during this time. There are also other things that the
user can do which shows the same behaviour, dragging a scrollbar for
The second problem is that win32eventreactor uses a lot a cpu time -
nearly 100% even on my brandnew 2GHz P4. Looks much like polling behaviour
instead of event driven.
So I wrote my own reactor implementation, which passes all events
(those I've covered so far, reactor.callLater and network events)
through a win32 message loop. Deferred's are not yet passed through
the loop, so there is still some polling to be done.
Looking at the comments at the top of the win32eventreactor code,
my win32guireactor module shouldn't have the problems mentioned there.
I post this module here asking for peer review and critical comments.
This module requires win32all and my ctypes module as well,
see the source for details.
PS: I tried to run unittests with this and other reactors with
the command line
py22 bin\trial -p twisted.test.test_internet -r <reactor> -v
here are the results:
FAILED (failures=5, errors=18)
crashes with this traceback, and then also hangs forever.
testLongFileListings ... Traceback (most recent call last):
File "C:\sf\Twisted\twisted\internet\win32guireactor.py", line 85, in __wm_timerevent
File "C:\sf\Twisted\twisted\test\test_ftp.py", line 124, in errback
except self.failureException, e:
AttributeError: FTPClientAndServerTests instance has no attribute 'failureException'
Thank you very much for the hotel information.
In return: sushi information!
1503 17th St., NW (P St.)
Washington (202) 462-8999
It has been 2 years, but that was the best last time I was in D.C.
I have a pb (the same as the thread "Gtk version" when I try to run manhole:
Traceback (most recent call last):
File "/usr/bin/manhole", line 33, in ?
from twisted.scripts import manhole
File "/usr/lib/python2.2/site-packages/twisted/scripts/manhole.py", line
23, in ?
from twisted.spread.ui import gtkutil
File "/usr/lib/python2.2/site-packages/twisted/spread/ui/gtkutil.py", line
62, in ?
AttributeError: 'module' object has no attribute 'GtkWindow'
And if I look at the official page of PyGtk
I found this exemple :
window = gtk.Window(gtk.WINDOW_TOPLEVEL) # create a top level window
manhole pygtk seems to be outdated !
any idea ?
I like where this is going, and I certainly have no complaints about
dumping shortcut.py, but could you please review a few things before I
* Putting install-script into setup.cfg makes your change visible to
everyone who's building a distribution of Twisted. As you pointed out
yourself, you can't use install-script without distutils 1.0.3, and
Twisted has to support pythons 2.1 and 2.2. Will this config parameter be
ignored by setup.py when building a Twisted install on distutils <1.0.3 or
will it cause an error?
* You made this change to the test I use for isWinNT:
- if platform.isWinNT():
- return os.path.join(os.getenv("SYSTEMROOT"),
- "system32", "shell32.dll")
+ # If SYSTEMROOT is not found (on Win98), guess the name
+ # of the windows directory
+ isNT = 0
+ isNT = 1
+ except OSError: # probably Win98
Is the implementation of platform.isWinNT() broken? If so, I'd rather you
patched it there. If not, I'd rather keep using it.
* Most important thing: test_postinstall doesn't work with this patch,
because create_shortcut and get_special_folder_path appear to be magical
builtins installed by distutils. I'll be happy to rewrite the test if you
can point me to the right place to import this code when it's not
available as a builtin.
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
i had hacked the rpy below, to serve files (those specified by the left
over part of the url,
and rooted on a hard-wired rootdir on the system) following the
this list, picking from the example bits, and salvaging whatever ideas
from the docs. However the mental model i'd like to form is still very
After Clark's post from yesterday, I tried to redo this in the "proper"
i.e. using putChild. However, the best i could get was
"Request did not return a string", when trying putChild and getChild
as the content of the render() method below (with isLeaf=0).
Would anyone be able to clarify what the render() method should be
such that the url http://host/docs/some/file.txt will return the file
at system location of: /Path/To/Somewhere/some/file.txt ?
Oh, and in general, how does one turn off directory browsing
for a twisted.web server?
from twisted.protocols import http
from twisted.web import resource, error
docsBase = '/Path/To/Somewhere'
serveFileTypes = ['','.txt','.pdf','.gif']
def render(self, request):
# a few var used in blocks below
subPath = '/'.join(request.postpath)
fullPath = docsBase +'/'+ subPath
rootPath = '/docs/'+subPath
if not len(subPath):
rootPath = '/docs'+subPath # otherwise get double slash
(when postpath is zero length)
dirlist = 
# build list or return file
if not os.path.exists(fullPath):
raise Exception # of type...
dirlist = processDirlist(os.listdir(fullPath))
mimetype = mimetypes.guess_type(fullPath)
if not mimetype:
mimetype = 'text/plain' # fallback
f = open(fullPath)
raise Exception # of type..
errpage = error.ErrorPage(http.NOT_FOUND,"Not
# response string
s = '<ul>'
for file in dirlist:
s += '<li><a href="%s">%s</li>' % ( rootPath+'/'+file, file
s += '</ul>'
title = 'Directory listing for ' + rootPath
html>''' % (title,title,s)
resource = RestrictedResource()
dl = 
for filename in dirlist:
(name, suffix) = os.path.splitext(filename)
if suffix in serveFileTypes: