summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7752e0f)
FIXES:
- Removed ecore necessity from python-purple. Clients which should use
it can now have their own main loop which doesn't need to be ecore.
This patch was initially sent by Luca Bigliardi.
Signed-off-by: Luca Bigliardi <shammash@artha.org>
Signed-off-by: Bruno Abinader <bruno.abinader@openbossa.org>
# Sets initial parameters
self.core = purple.Purple(__NAME__, __VERSION__, __WEBSITE__, \
__DEV_WEBSITE__, debug_enabled=True, default_path='/tmp')
# Sets initial parameters
self.core = purple.Purple(__NAME__, __VERSION__, __WEBSITE__, \
__DEV_WEBSITE__, debug_enabled=True, default_path='/tmp')
+ ecore.Timer(0.01, self.core.iterate_main_loop)
self.account = None
self.buddies = {}
self.conversations = {}
self.account = None
self.buddies = {}
self.conversations = {}
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import getpass
import purple
import sys
import getpass
import purple
import sys
# The information below is needed by libpurple
__NAME__ = "nullclient"
# The information below is needed by libpurple
__NAME__ = "nullclient"
# Enable account (connects automatically)
account.set_enabled(True)
# Enable account (connects automatically)
account.set_enabled(True)
- # Initializes ecore mainloop
- ecore.main_loop_begin()
+ while True:
+ core.iterate_main_loop()
+ time.sleep(0.01)
cdef extern from "c_purple.h":
glib.guint glib_input_add(glib.gint fd, eventloop.PurpleInputCondition condition, eventloop.PurpleInputFunction function, glib.gpointer data)
cdef extern from "c_purple.h":
glib.guint glib_input_add(glib.gint fd, eventloop.PurpleInputCondition condition, eventloop.PurpleInputFunction function, glib.gpointer data)
import signal
cdef glib.GHashTable *c_ui_info
import signal
cdef glib.GHashTable *c_ui_info
if default_path:
util.purple_util_set_user_dir(default_path)
if default_path:
util.purple_util_set_user_dir(default_path)
- # adds glib iteration inside ecore main loop
- ecore.timer_add(0.001, self.__glib_iteration_when_idle)
-
# libpurple's built-in DNS resolution forks processes to perform
# blocking lookups without blocking the main process. It does not
# handle SIGCHLD itself, so if the UI does not you quickly get an army
# libpurple's built-in DNS resolution forks processes to perform
# blocking lookups without blocking the main process. It does not
# handle SIGCHLD itself, so if the UI does not you quickly get an army
glib.g_hash_table_insert(c_ui_info, "dev_website", c_ui_dev_website)
return c_ui_info
glib.g_hash_table_insert(c_ui_info, "dev_website", c_ui_dev_website)
return c_ui_info
- def __glib_iteration_when_idle(self):
- glib.g_main_context_iteration(NULL, False)
- return True
-
def purple_init(self):
'''Initializes the purple.
def purple_init(self):
'''Initializes the purple.
+ def iterate_main_loop(self):
+ glib.g_main_context_iteration(NULL, False)
+ return True
+
def protocols_get_all(self):
'''Returns a list of all protocols.
def protocols_get_all(self):
'''Returns a list of all protocols.