⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.122
Server IP:
13.127.59.50
Server:
Linux ip-172-31-46-210 5.15.0-1033-aws #37~20.04.1-Ubuntu SMP Fri Mar 17 11:39:30 UTC 2023 x86_64
Server Software:
Apache/2.4.41 (Ubuntu)
PHP Version:
7.4.3-4ubuntu2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3
/
dist-packages
/
twisted
/
internet
/
View File Name :
wxsupport.py
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # """Old method of wxPython support for Twisted. twisted.internet.wxreactor is probably a better choice. To use:: | # given a wxApp instance called myWxAppInstance: | from twisted.internet import wxsupport | wxsupport.install(myWxAppInstance) Use Twisted's APIs for running and stopping the event loop, don't use wxPython's methods. On Windows the Twisted event loop might block when dialogs are open or menus are selected. Maintainer: Itamar Shtull-Trauring """ import warnings warnings.warn("wxsupport is not fully functional on Windows, wxreactor is better.") from twisted.python._oldstyle import _oldStyle from twisted.internet import reactor @_oldStyle class wxRunner: """Make sure GUI events are handled.""" def __init__(self, app): self.app = app def run(self): """ Execute pending WX events followed by WX idle events and reschedule. """ # run wx events while self.app.Pending(): self.app.Dispatch() # run wx idle events self.app.ProcessIdle() reactor.callLater(0.02, self.run) def install(app): """Install the wxPython support, given a wxApp instance""" runner = wxRunner(app) reactor.callLater(0.02, runner.run) __all__ = ["install"]