r47288 - Merge reactor-app-py3-8299: Port twisted.plugins.twisted_reactors to Python 3

hawkowl-TA+aISz0psMTMxyoc4vAAJOcrHinNvQL0E9HWUfgJXw@public.gmane.org Sun, 17 Apr 2016 18:55:37 -0600 (MDT)
Newsgroups gmane.comp.python.twisted.commits
Message-ID <[email protected]>
Author: hawkowl
Date: Sun Apr 17 18:55:30 2016
New Revision: 47288

Added:
   trunk/twisted/topfiles/8299.bugfix
Modified:
   trunk/twisted/plugins/twisted_reactors.py
   trunk/twisted/python/dist3.py

Log:
Merge reactor-app-py3-8299: Port twisted.plugins.twisted_reactors to Python 3

Author: hawkowl
Reviewer: adiroiban
Fixes: #8299

Modified: trunk/twisted/plugins/twisted_reactors.py
==============================================================================
--- trunk/twisted/plugins/twisted_reactors.py	(original)
+++ trunk/twisted/plugins/twisted_reactors.py	Sun Apr 17 18:55:30 2016
@@ -1,7 +1,10 @@
 # Copyright (c) Twisted Matrix Laboratories.
 # See LICENSE for details.
 
+from __future__ import absolute_import, division
+
 from twisted.application.reactors import Reactor
+from twisted.python.compat import _PY3
 
 default = Reactor(
     'default', 'twisted.internet.default',
@@ -9,32 +12,45 @@
 
 select = Reactor(
     'select', 'twisted.internet.selectreactor', 'select(2)-based reactor.')
-wx = Reactor(
-    'wx', 'twisted.internet.wxreactor', 'wxPython integration reactor.')
-gi = Reactor(
-    'gi', 'twisted.internet.gireactor', 'GObject Introspection integration reactor.')
-gtk3 = Reactor(
-    'gtk3', 'twisted.internet.gtk3reactor', 'Gtk3 integration reactor.')
-gtk2 = Reactor(
-    'gtk2', 'twisted.internet.gtk2reactor', 'Gtk2 integration reactor.')
-glib2 = Reactor(
-    'glib2', 'twisted.internet.glib2reactor',
-    'GLib2 event-loop integration reactor.')
-glade = Reactor(
-    'debug-gui', 'twisted.manhole.gladereactor',
-    'Semi-functional debugging/introspection reactor.')
-win32er = Reactor(
-    'win32', 'twisted.internet.win32eventreactor',
-    'Win32 WaitForMultipleObjects-based reactor.')
+
 poll = Reactor(
     'poll', 'twisted.internet.pollreactor', 'poll(2)-based reactor.')
 epoll = Reactor(
     'epoll', 'twisted.internet.epollreactor', 'epoll(4)-based reactor.')
-cf = Reactor(
-    'cf' , 'twisted.internet.cfreactor',
-    'CoreFoundation integration reactor.')
+
 kqueue = Reactor(
     'kqueue', 'twisted.internet.kqreactor', 'kqueue(2)-based reactor.')
-iocp = Reactor(
-    'iocp', 'twisted.internet.iocpreactor',
-    'Win32 IO Completion Ports-based reactor.')
+
+__all__ = [
+    "default", "select", "poll", "epoll", "kqueue"
+]
+
+if not _PY3:
+    wx = Reactor(
+        'wx', 'twisted.internet.wxreactor', 'wxPython integration reactor.')
+    gi = Reactor(
+        'gi', 'twisted.internet.gireactor',
+        'GObject Introspection integration reactor.')
+    gtk3 = Reactor(
+        'gtk3', 'twisted.internet.gtk3reactor', 'Gtk3 integration reactor.')
+    gtk2 = Reactor(
+        'gtk2', 'twisted.internet.gtk2reactor', 'Gtk2 integration reactor.')
+    glib2 = Reactor(
+        'glib2', 'twisted.internet.glib2reactor',
+        'GLib2 event-loop integration reactor.')
+    glade = Reactor(
+        'debug-gui', 'twisted.manhole.gladereactor',
+        'Semi-functional debugging/introspection reactor.')
+    win32er = Reactor(
+        'win32', 'twisted.internet.win32eventreactor',
+        'Win32 WaitForMultipleObjects-based reactor.')
+    cf = Reactor(
+        'cf' , 'twisted.internet.cfreactor',
+        'CoreFoundation integration reactor.')
+    iocp = Reactor(
+        'iocp', 'twisted.internet.iocpreactor',
+        'Win32 IO Completion Ports-based reactor.')
+
+    __all__.extend([
+        "wx", "gi", "gtk2", "gtk3", "glib2", "glade", "win32er", "cf", "iocp"
+    ])

Modified: trunk/twisted/python/dist3.py
==============================================================================
--- trunk/twisted/python/dist3.py	(original)
+++ trunk/twisted/python/dist3.py	Sun Apr 17 18:55:30 2016
@@ -149,6 +149,7 @@
     "twisted.plugins.cred_unix",
     "twisted.plugins.twisted_core",
     "twisted.plugins.twisted_trial",
+    "twisted.plugins.twisted_reactors",
     "twisted.plugins.twisted_web",
     "twisted.positioning.__init__",
     "twisted.positioning._sentence",