xmlrpc client through proxy to https server

2008-08-12 Thread Gustavo Rahal
Hi

I'm trying to build a xmlrpc client that uses a proxy to connect to
a xmlrpc server in https.
I've googled and came up with a code snippet that doesn't actually
work.

What is missing?


class ProxiedTransport(xmlrpclib.Transport):
def set_proxy(self, proxy):
self.proxy = proxy
def make_connection(self, host):
self.realhost = host
# i've also tried httplib.HTTPS, in this case I get 
# "socket.sslerror: (1, 'error:140770FC:SSL 
routines:SSL23_GET_SERVER_HELLO:unknown protocol')"
h = httplib.HTTP(self.proxy) 
#trivial setup for ssl socket
#proxy_connect='CONNECT %s:%s HTTP/1.1\r\n'%('ftp3.linux.ibm.com', 
'443')
#user_agent='User-Agent: python\r\n'
#proxy_pieces=proxy_connect+user_agent+'\r\n'
#proxy=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
#proxy.connect(('9.47.67.150', 3128))
#proxy.sendall(proxy_pieces)
#response=proxy.recv(8192)
#ssl = socket.ssl(proxy, None, None)
#sock = httplib.FakeSocket(proxy, ssl)
#h.sock = sock
return h
def send_request(self, connection, handler, request_body):
connection.putrequest("POST", 'https://%s%s' % (self.realhost, handler))
def send_host(self, connection, host):
connection.putheader('Host', self.realhost)


p = ProxiedTransport()
p.set_proxy('9.47.67.150:3128')
server = xmlrpclib.Server('https://ftp3.linux.ibm.com/rpc/index.php', 
transport=p)
print server.user.ingroup("username", "group")

---

The Result:

xmlrpclib.ProtocolError: 


The method i'm calling is "implemented". If I try straight xmlrpc
connection through a machine that is not behind a firewall things work
fine.


Appreciate help

Thanks
Gustavo

--
http://mail.python.org/mailman/listinfo/python-list


Re: how to apply "mvc" pattern to gui-design in python

2005-03-28 Thread Gustavo Rahal
Swaroop C H wrote:
On Mon, 28 Mar 2005 17:26:14 +0800, Su Wei <[EMAIL PROTECTED]> wrote:
i have a project want to  develop with python.
who can tell me that how to apply "mvc" pattern to gui-design in python.
please give me some advices!
ths in advanced.

This may help you:
http://pygtkmvc.sourceforge.net/index.php/Main/Features
You can also try Kiwi:
http://www.async.com.br/projects/Kiwi/
Kiwi is still based on gtk 1.x but a redesign and gtk 2.X support is
almost done. Lorenzo Sanchez (gazpacho creator) is working at Async
full-time on the port. There will also be a very nice gazpacho
integration. For more info about a stable release contact him at:
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list


Re: Platform independent adduser script?

2005-02-21 Thread Gustavo Rahal
Hi
On redhat you can use a libuser module that provides some highlevel 
system tasks.
redhat-tools use this module all the time.. look at some sources

Gustavo
morphex wrote:
Hi there,
does anyone here know of a script that enables adding of users on UNIX
platforms via python?
Thanks,
Morten
--
http://mail.python.org/mailman/listinfo/python-list


thread / twisted defered etc...

2005-02-10 Thread Gustavo Rahal
Hi
To practice some programming skills I would like to make a mp3 player 
that fetches lyrics from websites. I want to use PyGTK and gstreamer.
I started some coding and i'm already stuck with the first problem.
Gtk freezes waiting for the lyric to be fetched, which I guess was 
expected. How to solve this and other similar problems (maybe gtk could 
freeze when using gstreamer)?
Someone pointed out defered from twisted package. Is it good a idea? 
What about using the module threading? Could it be a problem to use 
threads with GUI (gtk) apps?

I'm new to python, gtk and gstreamer so if possible detailed 
explanations are appreciated :)

Thanks
Gustavo
--
http://mail.python.org/mailman/listinfo/python-list