create trade object from clipboard
This commit is contained in:
parent
c598b45db4
commit
c8c108c695
@ -1,14 +1,21 @@
|
|||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
import time
|
import time
|
||||||
from .data import log
|
from . import data
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
|
def clipboard_poll(app: tk) -> None:
|
||||||
|
data.log.info('clipboard thread started')
|
||||||
|
text = None
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
new_text = app.clipboard_get()
|
||||||
|
except tk.TclError:
|
||||||
|
new_text = None
|
||||||
|
if new_text != text:
|
||||||
|
data.log.info(new_text)
|
||||||
|
text = new_text
|
||||||
|
res = data.re_clipboard.search(text)
|
||||||
|
if res:
|
||||||
|
trade = data.Trade.by_regex_result(res)
|
||||||
|
data.log.info(trade)
|
||||||
|
time.sleep(0.2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user