From: Ragner Magalhaes Date: Tue, 2 Dec 2008 20:37:28 +0000 (+0000) Subject: Setting proxy and protocols'options X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=commitdiff_plain;h=de9b6fd49b39c78ae49d8f09ae70ca4c3b8ec7b5;ds=inline Setting proxy and protocols'options Setting proxy and protocols'options Signed-off-by: Ragner Magalhaes git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1327 596f6dd7-e928-0410-a184-9e12fd12cf7e --- diff --git a/nullclient.py b/nullclient.py index bd428d0..6e717c3 100644 --- a/nullclient.py +++ b/nullclient.py @@ -138,16 +138,31 @@ class NullClient: self.p.purple_init(cbs) def set_protocol(self, protocol): - for i in self.p.get_protocols(): - if i[1] == protocol: + for p in self.p.get_protocols(): + if p.get_name() == protocol: print "-- NULLCLIENT --: Choosing %s as protocol" % protocol - self.protocol = i[0] - print "-- NULLCLIENT --: Protocol successfully chosen: %s" % i[0] + self.protocol = p + print "-- NULLCLIENT --: Protocol successfully chosen: %s" % p.get_id() return def new_account(self, username, protocol, password): - self.account = purple.Account(username, protocol) + self.account = purple.Account(username, protocol.get_id()) self.account.set_password(password) + + proxy = self.account.get_proxyinfo() + if proxy is None: + print "None" + proxy = purple.ProxyInfo() + proxy.cnew() + + proxy.set_type(purple.ProxyInfoType().HTTP()) + proxy.set_host("172.18.216.211") + proxy.set_port(8080) + + self.account.set_proxyinfo(proxy) + + self.account.get_protocol_options() + self.account.set_enabled("carman-purple-python", True) def get_buddies(self): buddies = self.account.get_buddies_online()