Been thinking about this. It _would_ be cool if you could have more than one
LivePage per browser session, like in popups, or even frames.
What do you think: Is there any obvious & fundamental reason why the
ReliableMessageDelivery stuff couldn't be modified, so that one instance of
it could be shared between several PageWidgets?
from twisted.web import client
from twisted.internet import reactor
print >> sys.stderr, "Error:", failure.getErrorMessage()
if len(sys.argv) == 4:
url = sys.argv
username = sys.argv
password = sys.argv
basicAuth = base64.encodestring('%s:%s' % (username, password))
authHeader = "Basic " + basicAuth.strip()
print 'Usage: get_web_page.py <URL>'
If I run this against a password protected HTTP(S) site from a host
that has direct access to the Internet it works fine. I now have to
move it behind a proxy that requires authentication. The Twisted
documentation did not make it clear (to me) how to add proxy
authentication and I cannot find an example on the Internet.
I've tried adding an additional Proxy-Authentication header to the
call, but that doesn't help Any ideas would be greatly appreciated.
This is my first post to this list.
I've been using Twisted for a few (like three) days. My wife had a
baby two days ago, no, really. I just got the other two kids to bed
and thought I'd ask...sorry if this has been answered eleven-thousand
times before but I did search the archives first.
I'm writing a client app that needs to get the contents of a URL,
usually just a web page.
I'm trying to use client.py's downloadPage(url, file,
contextFactory=None, *args, **kwargs):
It claims to use a 'file' which, according to the docstring, can be a
file or file-like object.
It uses the HTTPDownloader class to perform the actual download.
In the pageEnd(): method of HTTPDownloader, the 'file' is closed.
Unfortunately, for 'file-like' objects, like StringIOs, this trashes
the 'file'; not so useful since I need to work with the result.
I realize I can subclass and override and such but it seems odd that
a function that is documented to use a file-like object uses a class
that will destroy something that's not a 'file.'
I'm sure I'm missing something...or maybe nobody uses this 'cause
there's something way better that I haven't discovered yet.
AKA: Steve Steiner
I have an http server set up using twistd. I searched for some answers
on the web and saw something regarding getting the uploaded file from
request.content. I tried calling request.content.read and did not get
the file uploaded. I was able to see something if I call
request.content.seek(0) first, but the information is just the name of
the input field and the filename of the file that I uploaded. Am I
forgetting to do something to ensure that the file is actually
transferred? If somebody can point me to information about what's
available from the "request" object and how to use it, especially to
extract the uploaded file, that would really be helpful.
Tried to send this to divmod-dev(a)divmod.org, but post didn't show up
Might be an insanly stupid question but, is there a simple way to force
the reload of JScript code for nevow LivePages via a server issued
I ask because Firefox seems to cling to the JScript files until the user
forces it to forget them with 'Clear Private Data', which leads to ugly
mismatches between server and client side code.