[Pywikipedia-l] SVN: [6034] branches/rewrite/pywikibot/comms/http.py

russblau at svn.wikimedia.org russblau at svn.wikimedia.org
Mon Oct 27 20:22:38 UTC 2008


Revision: 6034
Author:   russblau
Date:     2008-10-27 20:22:38 +0000 (Mon, 27 Oct 2008)

Log Message:
-----------
set user-agent header

Modified Paths:
--------------
    branches/rewrite/pywikibot/comms/http.py

Modified: branches/rewrite/pywikibot/comms/http.py
===================================================================
--- branches/rewrite/pywikibot/comms/http.py	2008-10-27 15:51:24 UTC (rev 6033)
+++ branches/rewrite/pywikibot/comms/http.py	2008-10-27 20:22:38 UTC (rev 6034)
@@ -90,6 +90,7 @@
     baseuri = "%s://%s/" % (site.protocol(), site.hostname())
     uri = urlparse.urljoin(baseuri, uri)
 
+    kwargs.setdefault("headers", {})['user-agent'] = useragent
     request = threadedhttp.HttpRequest(uri, *args, **kwargs)
     http_queue.put(request)
     request.lock.acquire()





More information about the Pywikipedia-l mailing list