From: burris Date: Tue, 3 Sep 2002 08:22:22 +0000 (+0000) Subject: made user agent string a variable X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8571045b9470d3fd2beff982bc7f89a013b2f21c;p=quix0rs-apt-p2p.git made user agent string a variable --- diff --git a/xmlrpcclient.py b/xmlrpcclient.py index 866039f..230f3ad 100644 --- a/xmlrpcclient.py +++ b/xmlrpcclient.py @@ -4,11 +4,12 @@ from twisted.internet.defer import Deferred from xmlrpclib import loads, dumps +USER_AGENT = 'Python/Twisted XMLRPC 0.1' class XMLRPCClient(HTTPClient): def connectionMade(self): payload = dumps(self.args, self.method) self.sendCommand('POST', '/RPC2') - self.sendHeader('User-Agent', 'Python/Twisted XMLRPC 0.1') + self.sendHeader('User-Agent', USER_AGENT) self.sendHeader('Content-Type', 'text/xml') self.sendHeader('Content-Length', len(payload)) self.endHeaders()