Deleting plugin.pyx
authorRagner Magalhaes <ragner.magalhaes@openbossa.org>
Tue, 2 Dec 2008 20:42:58 +0000 (20:42 +0000)
committerAnderson Briglia <anderson.briglia@openbossa.org>
Sat, 28 Feb 2009 21:11:13 +0000 (17:11 -0400)
plugin.pyx is not necessary and Plugin(), Plugins() classes are not being used and necessary anymore.

Signed-off-by: Anderson Briglia <anderson.briglia@indt.org.br>

git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1343 596f6dd7-e928-0410-a184-9e12fd12cf7e

nullclient-ecore.py
nullclient.py
purple.pyx

index c38efa4..f2e9dd9 100644 (file)
@@ -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)
index ecda1f6..641e034 100644 (file)
@@ -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)
index 3385417..00b739e 100644 (file)
@@ -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()