summaryrefslogtreecommitdiffstats
path: root/presentty/server.py
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2017-09-21 17:02:11 -0700
committerToshio Kuratomi <a.badger@gmail.com>2017-09-21 18:58:39 -0700
commit319a8283c7d9c14911cd26c5710a395942d86c32 (patch)
tree1b1ad35c7a1a477b44840a3c115134947e66996d /presentty/server.py
parent308a06134d7749638c7ba3afcc4031f31ba09930 (diff)
downloadpresentty-python3-port-try2.tar.gz
presentty-python3-port-try2.tar.xz
presentty-python3-port-try2.zip
Initial python3 workpython3-port-try2
This is enough to get presentty to display the demo presentation all the way through. The Python3 version appears to have some slight performance problems (or perhaps it's a difference in behaviour) during transitions. On displaying a new slide, the text pulses once (gets brighter than it should be in its final state).
Diffstat (limited to 'presentty/server.py')
-rw-r--r--presentty/server.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/presentty/server.py b/presentty/server.py
index 74e64b2..ad4c441 100644
--- a/presentty/server.py
+++ b/presentty/server.py
@@ -13,11 +13,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import absolute_import, division, print_function
+
import os
import threading
-import SocketServer
-class ConsoleHandler(SocketServer.StreamRequestHandler):
+import six.moves.socketserver
+
+class ConsoleHandler(six.moves.socketserver.StreamRequestHandler):
def handle(self):
server = self.server.server
while True:
@@ -38,6 +41,7 @@ class ConsoleHandler(SocketServer.StreamRequestHandler):
i, slide.progressive_state, slide.title))
elif data == 'next':
i, slide = server.next()
+ #i, slide = next(server)
self.wfile.write('current %i %i %s\n' % (
i, slide.progressive_state, slide.title))
elif data == 'prev':
@@ -53,7 +57,7 @@ class ConsoleHandler(SocketServer.StreamRequestHandler):
size = server.size()
self.wfile.write('size %s %s\n' % size)
-class ThreadedTCPServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
+class ThreadedTCPServer(six.moves.socketserver.ThreadingMixIn, six.moves.socketserver.TCPServer):
allow_reuse_address=True
class ConsoleServer(object):