Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Chéramy <maxime@cheramy.net>2014-04-06 19:44:38 +0400
committerMaxime Chéramy <maxime@cheramy.net>2014-04-06 19:44:38 +0400
commit8e9fe049e51fd8de0d5aed47f5f72bd343bbaf13 (patch)
tree7a92991ddb1725e361a1227157e50fe43ca4b473
parentbee6e870ad19196aa6de82fe290234ef51b8d61c (diff)
idlequeue uses time in microseconds (even with Python 2).
-rw-r--r--nbxmpp/idlequeue.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/nbxmpp/idlequeue.py b/nbxmpp/idlequeue.py
index 478595d..be8be4b 100644
--- a/nbxmpp/idlequeue.py
+++ b/nbxmpp/idlequeue.py
@@ -529,10 +529,6 @@ class GlibIdleQueue(IdleQueue):
Creates a dict, which maps file/pipe/sock descriptor to glib event id
"""
self.events = {}
- if sys.version_info[0] == 2:
- self.current_time = gobject.get_current_time
- else:
- self.current_time = GLib.get_real_time
def _add_idle(self, fd, flags):
"""
@@ -571,3 +567,9 @@ class GlibIdleQueue(IdleQueue):
def process(self):
self._check_time_events()
+
+ if sys.version_info[0] == 2:
+ def current_time(self):
+ return gobject.get_current_time() * 1e6
+ else:
+ current_time = GLib.get_real_time