aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Twisted/py3/twisted/internet/main.py
diff options
context:
space:
mode:
authorshmel1k <shmel1k@ydb.tech>2023-11-26 18:16:14 +0300
committershmel1k <shmel1k@ydb.tech>2023-11-26 18:43:30 +0300
commitb8cf9e88f4c5c64d9406af533d8948deb050d695 (patch)
tree218eb61fb3c3b96ec08b4d8cdfef383104a87d63 /contrib/python/Twisted/py3/twisted/internet/main.py
parent523f645a83a0ec97a0332dbc3863bb354c92a328 (diff)
downloadydb-b8cf9e88f4c5c64d9406af533d8948deb050d695.tar.gz
add kikimr_configure
Diffstat (limited to 'contrib/python/Twisted/py3/twisted/internet/main.py')
-rw-r--r--contrib/python/Twisted/py3/twisted/internet/main.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/contrib/python/Twisted/py3/twisted/internet/main.py b/contrib/python/Twisted/py3/twisted/internet/main.py
new file mode 100644
index 0000000000..2a05ac9c6d
--- /dev/null
+++ b/contrib/python/Twisted/py3/twisted/internet/main.py
@@ -0,0 +1,37 @@
+# -*- test-case-name: twisted.internet.test.test_main -*-
+# Copyright (c) Twisted Matrix Laboratories.
+# See LICENSE for details.
+
+
+"""
+Backwards compatibility, and utility functions.
+
+In general, this module should not be used, other than by reactor authors
+who need to use the 'installReactor' method.
+"""
+
+
+from twisted.internet import error
+
+CONNECTION_DONE = error.ConnectionDone("Connection done")
+CONNECTION_LOST = error.ConnectionLost("Connection lost")
+
+
+def installReactor(reactor):
+ """
+ Install reactor C{reactor}.
+
+ @param reactor: An object that provides one or more IReactor* interfaces.
+ """
+ # this stuff should be common to all reactors.
+ import sys
+
+ import twisted.internet
+
+ if "twisted.internet.reactor" in sys.modules:
+ raise error.ReactorAlreadyInstalledError("reactor already installed")
+ twisted.internet.reactor = reactor
+ sys.modules["twisted.internet.reactor"] = reactor
+
+
+__all__ = ["CONNECTION_LOST", "CONNECTION_DONE", "installReactor"]