Start with clipboard

This commit is contained in:
2021-05-11 19:34:21 +02:00
parent 00098e3fa6
commit f6775a4717
2 changed files with 19 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
from argparse import ArgumentParser, Namespace from argparse import ArgumentParser, Namespace
from threading import Thread from threading import Thread
from src import config, gui, trader from src import config, gui, trader, clipboard
from src.data import compile_regex, log from src.data import compile_regex, log
@@ -20,7 +20,9 @@ if __name__ == "__main__":
log.debug('Compiling regex') log.debug('Compiling regex')
compile_regex(conf) compile_regex(conf)
app = gui.Gui() app = gui.Gui()
my_thread = Thread(target=trader.read_log, args=(conf['General']['log_file'], app)) reader_thread = Thread(target=trader.read_log, args=(conf['General']['log_file'], app))
log.debug(f'Starting reader thread for "{conf["General"]["log_file"]}"') log.debug(f'Starting reader thread for "{conf["General"]["log_file"]}"')
my_thread.start() reader_thread.start()
clipboard_thread = Thread(target=clipboard.clipboard_poll, args=())
clipboard_thread.start()
app.mainloop() app.mainloop()

14
src/clipboard.py Normal file
View File

@@ -0,0 +1,14 @@
import tkinter as tk
import time
from .data import log
def clipboard_poll() -> None:
log.info('clipboard thread started')
# data = None
# while True:
# new_data = gui.clipboard_get()
# if new_data != data:
# log.info(new_data)
# data = new_data
# time.sleep(0.2)