Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
5ce46ef5
Commit
5ce46ef5
authored
Jan 22, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the callback property to watcher.
parent
cdc1d6dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
src/gevent/libev/corecext.ppyx
src/gevent/libev/corecext.ppyx
+14
-14
No files found.
src/gevent/libev/corecext.ppyx
View file @
5ce46ef5
...
...
@@ -668,16 +668,7 @@ cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback
#define WATCHER_BASE(TYPE) \
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): \
_check_loop(self.loop) \
...
...
@@ -691,11 +682,11 @@ cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback
Py_DECREF(<PyObjectPtr>self) \
self._flags &= ~1 \
\
@property
\
def priority(self): \
return libev.ev_priority(&self._watcher) \
@property \
def priority(self):
\
return libev.ev_priority(&self._watcher)
\
\
@priority.setter \
@priority.setter
\
def priority(self, int priority): \
if libev.ev_is_active(&self._watcher): \
raise AttributeError("Cannot set priority of an active watcher") \
...
...
@@ -784,6 +775,15 @@ cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Ty
libev.ev_unref(self.loop._ptr)
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):
if Py_ReprEnter(<PyObjectPtr>self) != 0:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment