Commit 5ce46ef5 authored by Jason Madden's avatar Jason Madden

Move the callback property to watcher.

parent cdc1d6dd
...@@ -669,15 +669,6 @@ cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback ...@@ -669,15 +669,6 @@ cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback
cdef libev.ev_##TYPE _watcher \ cdef libev.ev_##TYPE _watcher \
\ \
\ \
@property \
def callback(self): \
return self._callback \
\
@callback.setter \
def callback(self, object callback): \
if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None: \
raise TypeError("Expected callable, not %r" % (callback, )) \
self._callback = callback \
\ \
def stop(self): \ def stop(self): \
_check_loop(self.loop) \ _check_loop(self.loop) \
...@@ -784,6 +775,15 @@ cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Ty ...@@ -784,6 +775,15 @@ cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Ty
libev.ev_unref(self.loop._ptr) libev.ev_unref(self.loop._ptr)
self._flags |= 2 self._flags |= 2
@property
def callback(self):
return self._callback
@callback.setter
def callback(self, object callback):
if callback is not None and not callable(callback):
raise TypeError("Expected callable, not %r" % (callback, ))
self._callback = callback
def __repr__(self): def __repr__(self):
if Py_ReprEnter(<PyObjectPtr>self) != 0: if Py_ReprEnter(<PyObjectPtr>self) != 0:
......
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