|
Revision 24441, 1.4 kB
(checked in by thijs, 1 year ago)
|
Merge maintainer-email-2438: Get rid of references to maintainer email addresses from code.
Author: thijs
Reviewer: exarkun
Fixes: #2438
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
"""Old method of wxPython support for Twisted. |
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
import warnings |
|---|
| 25 |
warnings.warn("wxsupport is not fully functional on Windows, wxreactor is better.") |
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
from wxPython.wx import wxApp |
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
from twisted.internet import reactor |
|---|
| 32 |
from twisted.python.runtime import platformType |
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
class wxRunner: |
|---|
| 36 |
"""Make sure GUI events are handled.""" |
|---|
| 37 |
|
|---|
| 38 |
def __init__(self, app): |
|---|
| 39 |
self.app = app |
|---|
| 40 |
|
|---|
| 41 |
def run(self): |
|---|
| 42 |
""" |
|---|
| 43 |
Execute pending WX events followed by WX idle events and |
|---|
| 44 |
reschedule. |
|---|
| 45 |
""" |
|---|
| 46 |
|
|---|
| 47 |
while self.app.Pending(): |
|---|
| 48 |
self.app.Dispatch() |
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
self.app.ProcessIdle() |
|---|
| 52 |
reactor.callLater(0.02, self.run) |
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
def install(app): |
|---|
| 56 |
"""Install the wxPython support, given a wxApp instance""" |
|---|
| 57 |
runner = wxRunner(app) |
|---|
| 58 |
reactor.callLater(0.02, runner.run) |
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
__all__ = ["install"] |
|---|