both check_id

This commit is contained in:
2020-03-29 10:26:19 +08:00
parent 6e2953e4e0
commit 74cbb72a55
8 changed files with 122 additions and 62 deletions

View File

@@ -2,6 +2,24 @@ import threading
import json
import time
import queue
import os
class Print_controller:
def __init__(self):
self.padding_queue = queue.Queue()
self.thread = threading.Thread(target=self.start_printing, args=(), daemon=True)
self.original_print = print
def start_printing(self):
while True:
word = self.padding_queue.get()
print(word)
def print_function(self, word, dp=None):
if dp:
word = '<%s> %s' % (dp.head.get('flag'), word)
self.padding_queue.put(word)
class Jsondata:
@@ -39,4 +57,7 @@ class Jsondata:
global_config = {}
msw_queue = queue.Queue()
jsondata = Jsondata()
jsondata = Jsondata()
print_controller = Print_controller()
print = print_controller.print_function