| OLD | NEW |
| (Empty) |
| 1 # -*- test-case-name: twisted.test.test_app -*- | |
| 2 # Copyright (c) 2001-2004 Twisted Matrix Laboratories. | |
| 3 # See LICENSE for details. | |
| 4 | |
| 5 | |
| 6 """Backwards compatability, and utility functions. | |
| 7 | |
| 8 In general, this module should not be used, other than by reactor authors | |
| 9 who need to use the 'installReactor' method. | |
| 10 | |
| 11 Maintainer: U{Itamar Shtull-Trauring<mailto:twisted@itamarst.org>} | |
| 12 """ | |
| 13 | |
| 14 import error | |
| 15 | |
| 16 CONNECTION_DONE = error.ConnectionDone('Connection done') | |
| 17 CONNECTION_LOST = error.ConnectionLost('Connection lost') | |
| 18 | |
| 19 def installReactor(reactor): | |
| 20 # this stuff should be common to all reactors. | |
| 21 import twisted.internet | |
| 22 import sys | |
| 23 assert not sys.modules.has_key('twisted.internet.reactor'), \ | |
| 24 "reactor already installed" | |
| 25 twisted.internet.reactor = reactor | |
| 26 sys.modules['twisted.internet.reactor'] = reactor | |
| 27 | |
| 28 __all__ = ["CONNECTION_LOST", "CONNECTION_DONE", "installReactor"] | |
| OLD | NEW |