projects
/
python-purple
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplifyed definitions call, moved signal callback example to Cython code.
[python-purple]
/
connection.pyx
diff --git
a/connection.pyx
b/connection.pyx
index
2e9a8f4
..
19da891
100644
(file)
--- a/
connection.pyx
+++ b/
connection.pyx
@@
-17,11
+17,21
@@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-cimport connection
+cimport purple
+
+cdef void signed_on_cb (connection.PurpleConnection *gc, glib.gpointer null):
+ cdef account.PurpleAccount *acc = connection.c_purple_connection_get_account(gc)
+ print "Account connected: %s %s" % (acc.username, acc.protocol_id)
cdef class Connection:
""" Connection class """
cdef connection.PurpleConnection *__conn
cdef class Connection:
""" Connection class """
cdef connection.PurpleConnection *__conn
+ def __init__(self):
+ pass
+
def connect(self):
def connect(self):
- connect_to_signals_for_demonstration_purposes_only()
+ cdef int handle
+
+ signals.c_purple_signal_connect(connection.c_purple_connections_get_handle(),
+ "signed-on", &handle, <signals.PurpleCallback> signed_on_cb, NULL)