git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
immediate take care of changed "visualize rotor movement" option
[enigma2.git]
/
e2reactor.py
diff --git
a/e2reactor.py
b/e2reactor.py
index 1ecd40e836812ca40309192c3894ea7420d6b61d..a3d8ce1907794f39795a648d2bbb4c104cb0ecb3 100644
(file)
--- a/
e2reactor.py
+++ b/
e2reactor.py
@@
-11,7
+11,7
@@
Maintainer: U{Felix Domke<mailto:tmbinc@elitedvb.net>}
import select, errno, sys
# Twisted imports
import select, errno, sys
# Twisted imports
-from twisted.python import log,
threadable,
failure
+from twisted.python import log, failure
from twisted.internet import main, posixbase, error
#from twisted.internet.pollreactor import PollReactor, poller
from twisted.internet import main, posixbase, error
#from twisted.internet.pollreactor import PollReactor, poller
@@
-27,6
+27,7
@@
POLL_DISCONNECTED = (select.POLLHUP | select.POLLERR | select.POLLNVAL)
class E2SharedPoll:
def __init__(self):
self.dict = { }
class E2SharedPoll:
def __init__(self):
self.dict = { }
+ self.eApp = getApplication()
def register(self, fd, eventmask = select.POLLIN | select.POLLERR | select.POLLOUT):
self.dict[fd] = eventmask
def register(self, fd, eventmask = select.POLLIN | select.POLLERR | select.POLLOUT):
self.dict[fd] = eventmask
@@
-35,7
+36,8
@@
class E2SharedPoll:
del self.dict[fd]
def poll(self, timeout = None):
del self.dict[fd]
def poll(self, timeout = None):
- return getApplication().poll(timeout, self.dict)
+ r = self.eApp.poll(timeout, self.dict)
+ return r
poller = E2SharedPoll()
poller = E2SharedPoll()
@@
-56,6
+58,9
@@
class PollReactor(posixbase.PosixReactorBase):
poller.register(fd, mask)
else:
if selectables.has_key(fd): del selectables[fd]
poller.register(fd, mask)
else:
if selectables.has_key(fd): del selectables[fd]
+
+
+ poller.eApp.interruptPoll()
def _dictRemove(self, selectable, mdict):
try:
def _dictRemove(self, selectable, mdict):
try:
@@
-131,6
+136,7
@@
class PollReactor(posixbase.PosixReactorBase):
POLLIN=select.POLLIN,
POLLOUT=select.POLLOUT):
"""Poll the poller for new events."""
POLLIN=select.POLLIN,
POLLOUT=select.POLLOUT):
"""Poll the poller for new events."""
+
if timeout is not None:
timeout = int(timeout * 1000) # convert seconds to milliseconds
if timeout is not None:
timeout = int(timeout * 1000) # convert seconds to milliseconds
@@
-183,6
+189,9
@@
class PollReactor(posixbase.PosixReactorBase):
if why:
self._disconnectSelectable(selectable, why, inRead)
if why:
self._disconnectSelectable(selectable, why, inRead)
+ def callLater(self, *args, **kwargs):
+ poller.eApp.interruptPoll()
+ return posixbase.PosixReactorBase.callLater(self, *args, **kwargs)
def install():
"""Install the poll() reactor."""
def install():
"""Install the poll() reactor."""