From: Ragner Magalhaes Date: Tue, 2 Dec 2008 20:42:58 +0000 (+0000) Subject: Deleting plugin.pyx X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=commitdiff_plain;h=6545aaed50154028f8e6fbac3cd08c972940cb40 Deleting plugin.pyx plugin.pyx is not necessary and Plugin(), Plugins() classes are not being used and necessary anymore. Signed-off-by: Anderson Briglia git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1343 596f6dd7-e928-0410-a184-9e12fd12cf7e --- diff --git a/nullclient-ecore.py b/nullclient-ecore.py index c38efa4..f2e9dd9 100644 --- a/nullclient-ecore.py +++ b/nullclient-ecore.py @@ -222,7 +222,7 @@ class NullClientPurple: self.window = MainWindow(self.quit) self.buddies = [] #online buddies self.account = None - self.protocol = None + self.protocol_id = "prpl-jabber" self.username = "carmanplugintest@gmail.com" self.password = "abc123def" @@ -249,15 +249,8 @@ class NullClientPurple: self.buddies.remove(bname) self.window.remove_buddy(bname) - def set_protocol(self, protocol): - for p in self.p.get_protocols(): - if p.get_name() == protocol: - self.protocol = p - return - def connect(self): - self.set_protocol("XMPP") - self.account = purple.Account(self.username, self.protocol.get_id()) + self.account = purple.Account(self.username, self.protocol_id) self.account.set_password(self.password) self.account.proxy.set_type(purple.ProxyInfoType().HTTP) diff --git a/nullclient.py b/nullclient.py index ecda1f6..641e034 100644 --- a/nullclient.py +++ b/nullclient.py @@ -183,21 +183,14 @@ class NullClient: def __init__(self): self.p = purple.Purple(debug_enabled=False) self.account = None + self.protocol_id = "prpl-jabber" def execute(self): global cbs self.p.purple_init(cbs) - def set_protocol(self, protocol): - for p in self.p.get_protocols(): - if p.get_name() == protocol: - print "-- NULLCLIENT --: Choosing %s as protocol" % protocol - 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.get_id()) + def new_account(self, username, password): + self.account = purple.Account(username, self.protocol_id) self.account.set_password(password) self.account.proxy.set_type(purple.ProxyInfoType().HTTP) @@ -223,10 +216,9 @@ if __name__ == '__main__': client = NullClient() client.execute() - client.set_protocol("XMPP") username = getuser() password = getpassword() - client.new_account(username, client.protocol, password) + client.new_account(username, password) client.p.connect() client.p.attach_signals(signal_cbs) diff --git a/purple.pyx b/purple.pyx index 3385417..00b739e 100644 --- a/purple.pyx +++ b/purple.pyx @@ -24,8 +24,6 @@ cdef extern from "c_purple.h": import ecore -include "plugin.pyx" - __DEFAULT_PATH__ = "/tmp" __APP_NAME__ = "carman-purple-python" __APP_VERSION__ = "0.1" @@ -65,8 +63,6 @@ cdef class Purple: @parm default_path: Full path for libpurple user files. """ - cdef Plugins plugins - def __init__(self, debug_enabled=True, app_name=__APP_NAME__, default_path=__DEFAULT_PATH__): if app_name is not __APP_NAME__: __APP_NAME__ = app_name @@ -77,7 +73,6 @@ cdef class Purple: debug.c_purple_debug_set_enabled(debug_enabled) util.c_purple_util_set_user_dir(default_path) plugin.c_purple_plugins_add_search_path(default_path) - self.plugins = Plugins() # adds glib iteration inside ecore main loop ecore.timer_add(0.001, self.__glib_iteration_when_idle) @@ -254,9 +249,6 @@ cdef class Purple: return ret - def get_protocols(self): - return self.plugins.get_protocols() - def connect(self): conn = Connection() conn.connect()