From: Ragner Magalhaes Date: Tue, 2 Dec 2008 21:11:08 +0000 (+0000) Subject: Added Account class parent (core). X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=commitdiff_plain;h=5d7c705f607003997a097b353d02483b57cb61b9 Added Account class parent (core). FIXES: - Added Account class parent (core). Signed-off-by: Bruno Abinader Acked-by: Ragner Magalhaes Acked-by: Ricardo Guimaraes git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1419 596f6dd7-e928-0410-a184-9e12fd12cf7e --- diff --git a/account.pyx b/account.pyx index 16e5dcd..a6d2412 100644 --- a/account.pyx +++ b/account.pyx @@ -24,11 +24,13 @@ from protocol import Protocol cdef class Account: """ Account class + @param core @param username @param protocol_id """ - def __init__(self, username, protocol_id): + def __init__(self, core, username, protocol_id): + self.__core = core self.__username = username self.__protocol = Protocol(self, protocol_id) @@ -63,6 +65,10 @@ cdef class Account: return None is_disconnected = property(__is_disconnected) + def __get_core(self): + return self.__core + core = property(__get_core) + def __get_exists(self): return self.__exists exists = property(__get_exists) diff --git a/purple.pyx b/purple.pyx index c91acdc..9601af7 100644 --- a/purple.pyx +++ b/purple.pyx @@ -82,6 +82,10 @@ cdef class Purple: # adds glib iteration inside ecore main loop ecore.timer_add(0.001, self.__glib_iteration_when_idle) + def __get_ui_name(self): + return __APP_NAME__ + ui_name = property(__get_ui_name) + def destroy(self): core.c_purple_core_quit() @@ -369,7 +373,7 @@ cdef class Purple: protocol_id = account.purple_account_get_protocol_id(acc) if username != NULL and protocol_id != NULL: - account_list.append(Account(username, protocol_id)) + account_list.append(Account(self, username, protocol_id)) iter = iter.next return account_list