Commit 96b65df3 authored by Jason Madden's avatar Jason Madden

Convert remaining old-style properties into @propery

parent 41c260fa
......@@ -344,25 +344,21 @@ cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:
libev.ev_loop_destroy(self._ptr)
self._ptr = NULL
property ptr:
def __get__(self):
return <size_t>self._ptr
property WatcherType:
def __get__(self):
return watcher
property MAXPRI:
@property
def ptr(self):
return <size_t>self._ptr
def __get__(self):
return libev.EV_MAXPRI
@property
def WatcherType(self):
return watcher
property MINPRI:
@property
def MAXPRI(self):
return libev.EV_MAXPRI
def __get__(self):
return libev.EV_MINPRI
@property
def MINPRI(self):
return libev.EV_MINPRI
def _handle_syserr(self, message, errno):
if sys.version_info[0] >= 3:
......@@ -429,45 +425,39 @@ cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:
def __repr__(self):
return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format())
property default:
def __get__(self):
_check_loop(self)
return True if libev.ev_is_default_loop(self._ptr) else False
property iteration:
def __get__(self):
_check_loop(self)
return libev.ev_iteration(self._ptr)
property depth:
def __get__(self):
_check_loop(self)
return libev.ev_depth(self._ptr)
property backend_int:
@property
def default(self):
_check_loop(self)
return True if libev.ev_is_default_loop(self._ptr) else False
def __get__(self):
_check_loop(self)
return libev.ev_backend(self._ptr)
@property
def iteration(self):
_check_loop(self)
return libev.ev_iteration(self._ptr)
property backend:
@property
def depth(self):
_check_loop(self)
return libev.ev_depth(self._ptr)
def __get__(self):
_check_loop(self)
cdef unsigned int backend = libev.ev_backend(self._ptr)
for key, value in _flags:
if key == backend:
return value
return backend
@property
def backend_int(self):
_check_loop(self)
return libev.ev_backend(self._ptr)
property pendingcnt:
@property
def backend(self):
_check_loop(self)
cdef unsigned int backend = libev.ev_backend(self._ptr)
for key, value in _flags:
if key == backend:
return value
return backend
def __get__(self):
_check_loop(self)
return libev.ev_pending_count(self._ptr)
@property
def pendingcnt(self):
_check_loop(self)
return libev.ev_pending_count(self._ptr)
#ifdef _WIN32
def io(self, libev.vfd_socket_t fd, int events, ref=True, priority=None):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment