libevent: add _version_info() method

it provides info about python-event's and libevent's versions and the polling method
This commit is contained in:
Denis Bilenko
2009-06-24 18:50:35 +07:00
parent a13ed580c1
commit a420bcb6d8

View File

@@ -196,6 +196,19 @@ class Hub(object):
def get_excs(self):
return self.excs
def _version_info(self):
baseversion = event.__version__
try:
from ctypes import CDLL, util, c_char_p
c = CDLL(util.find_library('event'))
c.event_get_version.restype = c_char_p
baseversion += '/libevent=%s' % (c.event_get_version(), )
c.event_get_method.restype = c_char_p
baseversion += '/method=%s' % (c.event_get_method(), )
except Exception, ex:
print ex or type(ex).__name__
return baseversion
def _scheduled_call(event_impl, handle, evtype, arg):
cb, args, kwargs = arg