From bceb4b7ba9ac40e56b251de86281acd8c281984e Mon Sep 17 00:00:00 2001 From: awlx Date: Mon, 18 Sep 2023 15:57:51 +0200 Subject: [PATCH] Add black --- wgkex/worker/msg_queue.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/wgkex/worker/msg_queue.py b/wgkex/worker/msg_queue.py index 214628b..bf811ef 100644 --- a/wgkex/worker/msg_queue.py +++ b/wgkex/worker/msg_queue.py @@ -3,18 +3,22 @@ from queue import Queue from wgkex.common import logger from wgkex.worker.netlink import link_handler -from wgkex.worker.netlink import WireGuardClient - -class UniqueQueue(Queue): - def put(self, item, block=True, timeout=None): - if item not in self.queue: # fix join bug - Queue.put(self, item, block, timeout) - def _init(self, maxsize): - self.queue = set() - def _put(self, item): - self.queue.add(item) - def _get(self): - return self.queue.pop() +from wgkex.worker.netlink import WireGuardClient + + +class UniqueQueue(Queue): + def put(self, item, block=True, timeout=None): + if item not in self.queue: # fix join bug + Queue.put(self, item, block, timeout) + + def _init(self, maxsize): + self.queue = set() + + def _put(self, item): + self.queue.add(item) + + def _get(self): + return self.queue.pop() q = UniqueQueue()