aboutsummaryrefslogtreecommitdiff
path: root/socketserver.py
diff options
context:
space:
mode:
Diffstat (limited to 'socketserver.py')
-rw-r--r--socketserver.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/socketserver.py b/socketserver.py
index 74f0940..eb7d4fc 100644
--- a/socketserver.py
+++ b/socketserver.py
@@ -34,14 +34,14 @@ actions = {
"layout" : lambda x : x,
}
+from consumer import Mapping # Event used to send the mapping change request
+
class Handler(object):
""" Listen the incomming connexions and dispatch them into the connexion
object """
- def __init__(self, configuration, layout_queue):
+ def __init__(self, configuration):
""" Initialize the the socket server
-
- The layout_queue will be populated with all the elements received from the socket.
"""
super().__init__()
self.sel = selectors.DefaultSelector()
@@ -66,7 +66,6 @@ class Handler(object):
self.connexions = []
- self.layout_queue = layout_queue
@component.adapter(ISocketMessage)
def sendMessage(self, content:ISocketMessage) -> None:
@@ -130,11 +129,11 @@ class Handler(object):
# As we have a name in the configuration to associate with, use
# this name as a reference
for title in self.application_name:
- self.layout_queue.put((js, title))
+ component.handle(Mapping((js, title)))
else:
# Associate the layout with the current window
title = component.queryUtility(desktopEvent.IDesktop).getForegroundWindowTitle()
- self.layout_queue.put((js, title))
+ component.handle(Mapping((js, title)))
def _send(self:object, conn:socket, mask:int, text) -> None:
""" Internal method used to dispatch the message to the socket. """