Did any of the code wrap lines? Python is very sensitive to indentation.
If the current lines use spaces for indentation, make sure you don't use
tabs. Also, make sure that each indented line is 4-spaces (or a multiple
of 4 for each extra level of indentation).
Regards,
Phil
On Mon, 27 Sep 2010, Tim Evans wrote:
>
> Phil Schwartz wrote:
>>
>> It looks like it's not that hard to accomplish Tim but I don't have any
>> proxies setup to test it out on. Basically, you would copy the code at
>> the code (at the link that Daniel provided) with the exception of the last
>> 4 lines to the top of sync.py.
>
> Must've done this wrong, as I now get a syntax error referencing line 17,
> which is the old second line of the script. (Sorry, I'm pretty
> python-illiterate.)
>
> import xmlrpclib, httplib
>
> class ProxiedTransport(xmlrpclib.Transport):
> def set_proxy(self, proxy):
> self.proxy = proxy
> def make_connection(self, host):
> self.realhost = host
> h = httplib.HTTP(self.proxy)
> return h
> def send_request(self, connection, handler, request_body):
> connection.putrequest("POST", 'http://%s%s' % (self.realhost,
> handler))
> def send_host(self, connection, host):
> connection.putheader('Host', self.realhost)
>
>
> from xmlrpclib import ServerProxy
> import logging
>
>
--
Regards,
Phil Schwartz
http://www.phil-schwartz.com
Open Source Projects:
DenyHosts: http://www.denyhosts.net
Kodos: http://kodos.sourceforge.net
ReleaseForge: http://releaseforge.sourceforge.net
Scratchy: http://scratchy.sourceforge.net
FAQtor: http://faqtor.sourceforge.net
Become a fan of DenyHosts:
http://www.facebook.com/pages/DenyHosts/58269629216
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Denyhosts-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/denyhosts-user