diff --git a/libgrabsite/server.py b/libgrabsite/server.py index e395295..cf47545 100644 --- a/libgrabsite/server.py +++ b/libgrabsite/server.py @@ -9,7 +9,7 @@ import asyncio import aiohttp.web from autobahn.asyncio.websocket import WebSocketServerFactory, WebSocketServerProtocol -class MyServerProtocol(WebSocketServerProtocol): +class GrabberServerProtocol(WebSocketServerProtocol): def __init__(self): super().__init__() self.mode = "dashboard" @@ -63,8 +63,8 @@ class MyServerProtocol(WebSocketServerProtocol): }) -class MyServerFactory(WebSocketServerFactory): - protocol = MyServerProtocol +class GrabberServerFactory(WebSocketServerFactory): + protocol = GrabberServerProtocol def __init__(self): super().__init__() @@ -98,7 +98,7 @@ def main(): httpCoro = httpServer(loop, httpInterface, httpPort) loop.run_until_complete(httpCoro) - wsFactory = MyServerFactory() + wsFactory = GrabberServerFactory() wsCoro = loop.create_server(wsFactory, wsInterface, wsPort) loop.run_until_complete(wsCoro) diff --git a/libgrabsite/wpull_hooks.py b/libgrabsite/wpull_hooks.py index 3c3d451..073ca48 100644 --- a/libgrabsite/wpull_hooks.py +++ b/libgrabsite/wpull_hooks.py @@ -17,7 +17,7 @@ def printToReal(s): sys.stdout.buffer.flush() -class MyClientProtocol(WebSocketClientProtocol): +class GrabberClientProtocol(WebSocketClientProtocol): def onOpen(self): self.factory.client = self printToReal("{} connected to WebSocket server".format(self.__class__.__name__)) @@ -37,15 +37,15 @@ class MyClientProtocol(WebSocketClientProtocol): self.sendMessage(json.dumps(obj).encode("utf-8")) -class MyClientFactory(WebSocketClientFactory): - protocol = MyClientProtocol +class GrabberClientFactory(WebSocketClientFactory): + protocol = GrabberClientProtocol def __init__(self): super().__init__() self.client = None -wsFactory = MyClientFactory() +wsFactory = GrabberClientFactory() @asyncio.coroutine def connectToServer():