/usr/lib/python2.7/dist-packages/zmq/green/eventloop/ioloop.py is in python-zmq 14.0.1-1build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | from zmq.green import Poller
from zmq.eventloop.ioloop import *
RealIOLoop = IOLoop
RealZMQPoller = ZMQPoller
class IOLoop(RealIOLoop):
def __init__(self, impl=None):
if impl is None:
impl = _poll()
super(IOLoop, self).__init__(impl=impl)
# these methods are copied verbatim from the real IOLoop
@staticmethod
def instance():
if not hasattr(IOLoop, "_instance"):
with IOLoop._instance_lock:
if not hasattr(IOLoop, "_instance"):
# New instance after double check
IOLoop._instance = IOLoop()
return IOLoop._instance
@staticmethod
def initialized():
return hasattr(IOLoop, "_instance")
def install(self):
assert not IOLoop.initialized()
IOLoop._instance = self
class ZMQPoller(RealZMQPoller):
"""gevent-compatible version of ioloop.ZMQPoller"""
def __init__(self):
self._poller = Poller()
_poll = ZMQPoller
|