Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

[python 3] Replace SocketServer with socketserver #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions fah/util/SingleApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
import sys
import socket
import threading
import SocketServer

try:
import socketserver
except ImportError:
import SocketServer as socketserver

import gtk

Expand All @@ -30,7 +34,7 @@
single_app_addr = (single_app_host, single_app_port)


class SingleAppRequestHandler(SocketServer.BaseRequestHandler):
class SingleAppRequestHandler(socketserver.BaseRequestHandler):
def handle(self):
cmd = self.request.recv(1024).strip()

Expand All @@ -44,7 +48,7 @@ def handle(self):



class SingleAppServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
class SingleAppServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
allow_reuse_address = True

def __init__(self):
Expand All @@ -54,7 +58,7 @@ def __init__(self):
self.ping = threading.Event()
self.exit_requested = threading.Event()

SocketServer.TCPServer.__init__(
socketserver.TCPServer.__init__(
self, single_app_addr, SingleAppRequestHandler)

thread = threading.Thread(target = self.serve_forever)
Expand Down