Commit 95f8ccb6 authored by Guido van Rossum's avatar Guido van Rossum

Remove space between function/class name and following left

parenthesis.
parent 03867188
......@@ -20,7 +20,7 @@ import thread
if os.name == 'posix':
class trigger (asyncore.file_dispatcher):
class trigger(asyncore.file_dispatcher):
"Wake up a call to select() running in the main thread"
......@@ -52,10 +52,10 @@ if os.name == 'posix':
# new data onto a channel's outgoing data queue at the same time that
# the main thread is trying to remove some]
def __init__ (self):
def __init__(self):
r, w = self._fds = os.pipe()
self.trigger = w
asyncore.file_dispatcher.__init__ (self, r)
asyncore.file_dispatcher.__init__(self, r)
self.lock = thread.allocate_lock()
self.thunks = []
self._closed = None
......@@ -73,29 +73,29 @@ if os.name == 'posix':
for fd in self._fds:
os.close(fd)
def __repr__ (self):
def __repr__(self):
return '<select-trigger (pipe) at %x>' % id(self)
def readable (self):
def readable(self):
return 1
def writable (self):
def writable(self):
return 0
def handle_connect (self):
def handle_connect(self):
pass
def pull_trigger (self, thunk=None):
def pull_trigger(self, thunk=None):
if thunk:
try:
self.lock.acquire()
self.thunks.append (thunk)
self.thunks.append(thunk)
finally:
self.lock.release()
os.write (self.trigger, 'x')
os.write(self.trigger, 'x')
def handle_read (self):
self.recv (8192)
def handle_read(self):
self.recv(8192)
try:
self.lock.acquire()
for thunk in self.thunks:
......@@ -116,13 +116,13 @@ else:
# win32-safe version
class trigger (asyncore.dispatcher):
class trigger(asyncore.dispatcher):
address = ('127.9.9.9', 19999)
def __init__ (self):
a = socket.socket (socket.AF_INET, socket.SOCK_STREAM)
w = socket.socket (socket.AF_INET, socket.SOCK_STREAM)
def __init__(self):
a = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
w = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# set TCP_NODELAY to true to avoid buffering
w.setsockopt(socket.IPPROTO_TCP, 1, 1)
......
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